BUG/MINOR: config: Fix memory leak on config parse listen
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 18 Sep 2020 13:59:39 +0000 (15:59 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 18 Sep 2020 14:17:09 +0000 (16:17 +0200)
This memory leak happens if there is two or more defaults section. When
the default proxy is reinitialized, the structure member containing the
config filename must be freed.

Fix github issue #851.
Should be backported as far as 1.6.

src/cfgparse-listen.c

index bbdf699..cdfca5b 100644 (file)
@@ -479,6 +479,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                        goto out;
                }
 
+               free(defproxy.conf.file);
                free(defproxy.check_command);
                free(defproxy.check_path);
                free(defproxy.cookie_name);