diff options
author | 2014-05-07 01:23:52 +0000 | |
---|---|---|
committer | 2014-05-07 01:23:52 +0000 | |
commit | 2266d133c1ecff703d68f40c7c967083aa5e55f1 (patch) | |
tree | 15151d57a111bceb0e293cc284a418ec83de7718 | |
parent | calloc is simpler. suggested by Peter Malone and halex (diff) | |
download | wireguard-openbsd-2266d133c1ecff703d68f40c7c967083aa5e55f1.tar.xz wireguard-openbsd-2266d133c1ecff703d68f40c7c967083aa5e55f1.zip |
use calloc. from peter malone
Diffstat (limited to '')
-rw-r--r-- | usr.sbin/snmpd/mib.c | 5 |
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)); } |