]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Free after logging error incase free generates an error.
authorRoy Marples <roy@marples.name>
Thu, 21 Jul 2016 08:50:48 +0000 (08:50 +0000)
committerRoy Marples <roy@marples.name>
Thu, 21 Jul 2016 08:50:48 +0000 (08:50 +0000)
if-options.c

index 289b3badab2da06768683b4f9767e38139660cd6..4e7ad72f027fed46c1c0366942717806f39006a1 100644 (file)
@@ -1176,8 +1176,8 @@ 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__);
+                               free(p);
                                return -1;
                        }
                        ifo->config = nconf;