]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mworker: fix a memleak when execvp() failed
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 8 Jun 2020 08:01:13 +0000 (10:01 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Mon, 8 Jun 2020 08:01:13 +0000 (10:01 +0200)
Free next_argv when execvp() failed.

Must be backported as far as 1.8.

Should fix issue #668.

src/haproxy.c

index 92a54bab0f5e5a25f6d96446acb1b7904ae896c0..5d7b0fe9bbe633266e317a6c7106d4da40233844 100644 (file)
@@ -844,6 +844,8 @@ void mworker_reload()
        execvp(next_argv[0], next_argv);
 
        ha_warning("Failed to reexecute the master process [%d]: %s\n", pid, strerror(errno));
+       free(next_argv);
+       next_argv = NULL;
        return;
 
 alloc_error: