]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: cfgparse-listen: release the previous description of the proxy
authorWilly Tarreau <w@1wt.eu>
Tue, 15 Sep 2026 14:37:58 +0000 (16:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2026 07:22:33 +0000 (09:22 +0200)
The proxy's "description" keyword did not release the previous value
before assigning the new one, so the first one was leaked when the
keyword was used twice, e.g. once in a defaults section and once in the
proxy. Note that the global section's "description" does it properly.

This may be backported to all supported versions.

src/cfgparse-listen.c

index fe5337fe85755c610249d6768e69efe3e7eead66..b44376e06cf85f2f1774aecf150096d5fa331334 100644 (file)
@@ -749,6 +749,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                d = calloc(1, len);
                if (!d)
                        goto alloc_error;
+               ha_free(&curproxy->desc);
                curproxy->desc = d;
 
                d += snprintf(d, curproxy->desc + len - d, "%s", args[1]);