From 2266d133c1ecff703d68f40c7c967083aa5e55f1 Mon Sep 17 00:00:00 2001 From: tedu Date: Wed, 7 May 2014 01:23:52 +0000 Subject: [PATCH] use calloc. from peter malone --- usr.sbin/snmpd/mib.c | 5 ++--- 1 file 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 @@ -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)); } -- 2.20.1