From: Roy Marples Date: Fri, 3 May 2013 14:17:24 +0000 (+0000) Subject: Init memory cleanly. X-Git-Tag: v5.99.6~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1c69c23a9d788412594bdab5c24c115100a4d5a;p=thirdparty%2Fdhcpcd.git Init memory cleanly. --- diff --git a/dhcp6.c b/dhcp6.c index 13216bc5..dc1d4770 100644 --- a/dhcp6.c +++ b/dhcp6.c @@ -1081,7 +1081,7 @@ dhcp6_findna(struct interface *ifp, const uint8_t *iaid, ifp->name); continue; } - a = malloc(sizeof(*a)); + a = calloc(1, sizeof(*a)); if (a == NULL) { syslog(LOG_ERR, "%s: %m", __func__); break; @@ -1155,7 +1155,7 @@ dhcp6_findpd(struct interface *ifp, const uint8_t *iaid, ifp->name); continue; } - a = malloc(sizeof(*a)); + a = calloc(1, sizeof(*a)); if (a == NULL) { syslog(LOG_ERR, "%s: %m", __func__); break; @@ -1432,7 +1432,7 @@ dhcp6_delegate_addr(struct interface *ifp, const struct ipv6_addr *prefix, state->state = DH6S_DELEGATED; } - a = malloc(sizeof(*a)); + a = calloc(1, sizeof(*a)); if (a == NULL) { syslog(LOG_ERR, "%s: %m", __func__); return NULL;