From: Roy Marples Date: Thu, 26 Mar 2015 19:49:59 +0000 (+0000) Subject: Ensure our configured routes are allocated correctly. X-Git-Tag: v6.8.1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ec2a63b7a9f951e9517cc557783c8e9dcdf9c82;p=thirdparty%2Fdhcpcd.git Ensure our configured routes are allocated correctly. --- diff --git a/if-options.c b/if-options.c index e09310de..19bfc213 100644 --- a/if-options.c +++ b/if-options.c @@ -1038,7 +1038,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, } TAILQ_INIT(ifo->routes); } - rt = malloc(sizeof(*rt)); + rt = calloc(1, sizeof(*rt)); if (rt == NULL) { logger(ctx, LOG_ERR, "%s: %m", __func__); *fp = ' '; @@ -1063,7 +1063,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo, } TAILQ_INIT(ifo->routes); } - rt = malloc(sizeof(*rt)); + rt = calloc(1, sizeof(*rt)); if (rt == NULL) { logger(ctx, LOG_ERR, "%s: %m", __func__); return -1;