-/* $OpenBSD: parse.c,v 1.7 2012/07/16 19:57:17 jasper Exp $ */
+/* $OpenBSD: parse.c,v 1.8 2014/05/07 01:14:21 tedu Exp $ */
/* $NetBSD: parse.c,v 1.2 2001/12/29 20:44:22 augustss Exp $ */
/*
{
struct hid_data *s;
- s = malloc(sizeof *s);
+ s = calloc(1, sizeof *s);
if (s == NULL)
return (NULL);
- memset(s, 0, sizeof *s);
s->start = s->p = d->data;
s->end = d->data + d->size;
s->kindset = kindset;
-/* $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.
* 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>
__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);