From: Roy Marples Date: Thu, 30 Aug 2012 16:26:38 +0000 (+0000) Subject: Ensure we have correct memory allocation for number of prefixes. X-Git-Tag: v5.6.2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=259835194a0c73d0bb72f3fb30dd51da7119eb31;p=thirdparty%2Fdhcpcd.git Ensure we have correct memory allocation for number of prefixes. --- diff --git a/ipv6rs.c b/ipv6rs.c index 4d2bd244..3a8dd691 100644 --- a/ipv6rs.c +++ b/ipv6rs.c @@ -759,15 +759,9 @@ ipv6rs_env(char **env, const char *prefix, const struct interface *ifp) TAILQ_FOREACH(rao, &rap->options, next) { if (rao->option == NULL) continue; - if (env == NULL) { - switch (rao->type) { - case ND_OPT_PREFIX_INFORMATION: - break; - default: - l++; - } + l++; + if (env == NULL) continue; - } switch (rao->type) { case ND_OPT_PREFIX_INFORMATION: optn = "prefix"; @@ -786,7 +780,6 @@ ipv6rs_env(char **env, const char *prefix, const struct interface *ifp) } snprintf(buffer, sizeof(buffer), "ra%d_%s", i, optn); setvar(&env, prefix, buffer, rao->option); - l++; } }