summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-05-07 01:23:53 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-05-07 01:23:53 +0000
commit2abfa07acf4f44056d28eeb68dc2d6b3b63341ab (patch)
treeab5e1ca7f055d297d8a536c402535d612510ef58 /usr.sbin
parentf63d4ecfc4651d00ff7363edac41285721458122 (diff)
use calloc. from peter malone
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/snmpd/mib.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/snmpd/mib.c b/usr.sbin/snmpd/mib.c
index 1893e10fa2c..f92d2612d85 100644
--- a/usr.sbin/snmpd/mib.c
+++ b/usr.sbin/snmpd/mib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mib.c,v 1.68 2014/04/28 12:03:32 mikeb Exp $ */
+/* $OpenBSD: mib.c,v 1.69 2014/05/07 01:23:52 tedu Exp $ */
/*
* Copyright (c) 2012 Joel Knight <joel@openbsd.org>
@@ -2818,9 +2818,8 @@ mib_carpifget(u_int idx)
return (NULL);
}
- cif = malloc(sizeof(struct carpif));
+ cif = calloc(1, sizeof(struct carpif));
if (cif != NULL) {
- memset(cif, 0, sizeof(struct carpif));
memcpy(&cif->carpr, &carpr, sizeof(struct carpreq));
memcpy(&cif->kif, kif, sizeof(struct kif));
}