From 9fc6c97fb30bb9c15d6b6e34c917b0b5aba7486a Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Mon, 8 Jun 2020 10:01:13 +0200 Subject: [PATCH] BUG/MINOR: mworker: fix a memleak when execvp() failed Free next_argv when execvp() failed. Must be backported as far as 1.8. Should fix issue #668. --- src/haproxy.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/haproxy.c b/src/haproxy.c index 92a54bab0..5d7b0fe9b 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -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: