]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Ensure that env is freed in arraytostr() fails. Fixes [8d24cd2f25].
authorRoy Marples <roy@marples.name>
Mon, 15 Feb 2016 16:37:13 +0000 (16:37 +0000)
committerRoy Marples <roy@marples.name>
Mon, 15 Feb 2016 16:37:13 +0000 (16:37 +0000)
script.c

index 4fab7916b8a55395a732450e52f52bf8f9f36690..7fb3db6e2ff562cf011c072e32e08dc2ef3681e6 100644 (file)
--- a/script.c
+++ b/script.c
@@ -596,9 +596,9 @@ send_interface1(struct fd_list *fd, const struct interface *iface,
        elen = (size_t)arraytostr((const char *const *)env, &s);
        if ((ssize_t)elen == -1) {
                free(s);
-               return -1;
-       }
-       retval = control_queue(fd, s, elen, 1);
+               retval = -1;
+       } else
+               retval = control_queue(fd, s, elen, 1);
        ep = env;
        while (*ep)
                free(*ep++);