summaryrefslogtreecommitdiffstats
path: root/lib/libpcap/pcap.c
diff options
context:
space:
mode:
authorlteo <lteo@openbsd.org>2014-03-14 03:44:13 +0000
committerlteo <lteo@openbsd.org>2014-03-14 03:44:13 +0000
commit8d365cd491fb84475ed1d9f04dd021b27ddcc513 (patch)
tree1fe9863c0d06bebd4ded55402aa310041a59b8d9 /lib/libpcap/pcap.c
parentrework mplocks to use tickets instead of spinning. this provides (diff)
downloadwireguard-openbsd-8d365cd491fb84475ed1d9f04dd021b27ddcc513.tar.xz
wireguard-openbsd-8d365cd491fb84475ed1d9f04dd021b27ddcc513.zip
Change a few malloc+memset calls to calloc.
ok deraadt@ florian@
Diffstat (limited to 'lib/libpcap/pcap.c')
-rw-r--r--lib/libpcap/pcap.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libpcap/pcap.c b/lib/libpcap/pcap.c
index 591094fd2e7..9403efa340b 100644
--- a/lib/libpcap/pcap.c
+++ b/lib/libpcap/pcap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcap.c,v 1.13 2012/05/25 01:58:08 lteo Exp $ */
+/* $OpenBSD: pcap.c,v 1.14 2014/03/14 03:44:13 lteo Exp $ */
/*
* Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998
@@ -612,10 +612,9 @@ pcap_open_dead(int linktype, int snaplen)
{
pcap_t *p;
- p = malloc(sizeof(*p));
+ p = calloc(1, sizeof(*p));
if (p == NULL)
return NULL;
- memset (p, 0, sizeof(*p));
p->snapshot = snaplen;
p->linktype = linktype;
p->fd = -1;