diff options
author | tedu <tedu@openbsd.org> | 2014-05-07 01:14:21 +0000 |
---|---|---|
committer | tedu <tedu@openbsd.org> | 2014-05-07 01:14:21 +0000 |
commit | ee353af9ca6a214d130ac4c31183f294949ab49a (patch) | |
tree | ced4bbbf9652647d49c6465754f61d4c7ed1e98b /usr.sbin/npppd/l2tp | |
parent | miod forgot about fcrypt_b.c being needed, before he went off to get his (diff) | |
download | wireguard-openbsd-ee353af9ca6a214d130ac4c31183f294949ab49a.tar.xz wireguard-openbsd-ee353af9ca6a214d130ac4c31183f294949ab49a.zip |
use calloc. from Peter Malone
Diffstat (limited to 'usr.sbin/npppd/l2tp')
-rw-r--r-- | usr.sbin/npppd/l2tp/l2tpd.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/npppd/l2tp/l2tpd.c b/usr.sbin/npppd/l2tp/l2tpd.c index 2dd8827ec32..f1e9d74a9d6 100644 --- a/usr.sbin/npppd/l2tp/l2tpd.c +++ b/usr.sbin/npppd/l2tp/l2tpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: l2tpd.c,v 1.14 2014/03/22 04:32:39 yasuoka Exp $ */ +/* $OpenBSD: l2tpd.c,v 1.15 2014/05/07 01:16:15 tedu Exp $ */ /*- * Copyright (c) 2009 Internet Initiative Japan Inc. @@ -26,7 +26,7 @@ * SUCH DAMAGE. */ /**@file L2TP(Layer Two Tunneling Protocol "L2TP") / RFC2661 */ -/* $Id: l2tpd.c,v 1.14 2014/03/22 04:32:39 yasuoka Exp $ */ +/* $Id: l2tpd.c,v 1.15 2014/05/07 01:16:15 tedu Exp $ */ #include <sys/types.h> #include <sys/socket.h> #include <sys/time.h> @@ -162,12 +162,11 @@ l2tpd_add_listener(l2tpd *_this, int idx, struct l2tp_conf *conf, __func__, slist_length(&_this->listener), idx); goto fail; } - if ((plistener = malloc(sizeof(l2tpd_listener))) == NULL) { - l2tpd_log(_this, LOG_ERR, "malloc() failed in %s: %m", + if ((plistener = calloc(1, sizeof(l2tpd_listener))) == NULL) { + l2tpd_log(_this, LOG_ERR, "calloc() failed in %s: %m", __func__); goto fail; } - memset(plistener, 0, sizeof(l2tpd_listener)); L2TPD_ASSERT(sizeof(plistener->bind) >= addr->sa_len); memcpy(&plistener->bind, addr, addr->sa_len); |