From: tedu Date: Wed, 7 May 2014 01:23:52 +0000 (+0000) Subject: use calloc. from peter malone X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2266d133c1ecff703d68f40c7c967083aa5e55f1;p=openbsd use calloc. from peter malone --- 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 @@ -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)); }