]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix a potential memory leak if strdup fails, [6d370974e2]
authorRoy Marples <roy@marples.name>
Fri, 12 Feb 2016 19:37:02 +0000 (19:37 +0000)
committerRoy Marples <roy@marples.name>
Fri, 12 Feb 2016 19:37:02 +0000 (19:37 +0000)
if-options.c

index 3710cadc08d14b53a64a65a1e47d681cf73cff22..9097fa0d83e3fac429d716127780bdc24501fad5 100644 (file)
@@ -1137,6 +1137,7 @@ parse_option(struct dhcpcd_ctx *ctx, const char *ifname, struct if_options *ifo,
                        }
                        nconf = realloc(ifo->config, sizeof(char *) * (dl + 2));
                        if (nconf == NULL) {
+                               free(p);
                                logger(ctx, LOG_ERR, "%s: %m", __func__);
                                return -1;
                        }