From 9e298f67c05bb388258183fc56d860fcd0dac3f0 Mon Sep 17 00:00:00 2001 From: tedu Date: Wed, 7 May 2014 01:20:53 +0000 Subject: [PATCH] calloc is simpler. suggested by Peter Malone and halex --- usr.sbin/npppd/l2tp/l2tp_ctrl.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/usr.sbin/npppd/l2tp/l2tp_ctrl.c b/usr.sbin/npppd/l2tp/l2tp_ctrl.c index ffc88a6c884..012e889a938 100644 --- a/usr.sbin/npppd/l2tp/l2tp_ctrl.c +++ b/usr.sbin/npppd/l2tp/l2tp_ctrl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: l2tp_ctrl.c,v 1.16 2013/09/13 03:25:27 yasuoka Exp $ */ +/* $OpenBSD: l2tp_ctrl.c,v 1.17 2014/05/07 01:20:53 tedu Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -26,7 +26,7 @@ * SUCH DAMAGE. */ /**@file Control connection processing functions for L2TP LNS */ -/* $Id: l2tp_ctrl.c,v 1.16 2013/09/13 03:25:27 yasuoka Exp $ */ +/* $Id: l2tp_ctrl.c,v 1.17 2014/05/07 01:20:53 tedu Exp $ */ #include #include #include @@ -106,13 +106,8 @@ static u_int l2tp_ctrl_id_seq = 0; l2tp_ctrl * l2tp_ctrl_create(void) { - l2tp_ctrl *_this; - - if ((_this = malloc(sizeof(l2tp_ctrl))) == NULL) - return NULL; - memset(_this, 0, sizeof(l2tp_ctrl)); - return (l2tp_ctrl *)_this; + return calloc(1, sizeof(l2tp_ctrl)); } /** -- 2.20.1