]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Init memory cleanly.
authorRoy Marples <roy@marples.name>
Fri, 3 May 2013 14:17:24 +0000 (14:17 +0000)
committerRoy Marples <roy@marples.name>
Fri, 3 May 2013 14:17:24 +0000 (14:17 +0000)
dhcp6.c

diff --git a/dhcp6.c b/dhcp6.c
index 13216bc57f6b549f933b69993c7ccc2be052b9e5..dc1d47701cfe6a2b833884501edc881e42b83c16 100644 (file)
--- 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;