]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: proxy: add missing interface bind free in free_proxy
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 1 Jun 2023 08:58:44 +0000 (10:58 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 6 Jun 2023 13:15:17 +0000 (15:15 +0200)
bind->settings.interface hint is allocated when "interface" keyword
is specified on a bind line, but the string isn't explicitly freed in
proxy_free, resulting in minor memory leak on deinit paths when the
keyword is being used.

It partially fixes GH #2173 and may be backported to all stable versions.

[in 2.2 free_proxy did not exist so the patch must be applied directly
in deinit() function from haproxy.c]

src/proxy.c

index b932c0c2bdf96098204b3660abebffd3c21ff608..bc086865c0d9399a2d523f28639a9d1da1d496ec 100644 (file)
@@ -327,6 +327,7 @@ void free_proxy(struct proxy *p)
                        bind_conf->xprt->destroy_bind_conf(bind_conf);
                free(bind_conf->file);
                free(bind_conf->arg);
+               free(bind_conf->settings.interface);
                LIST_DELETE(&bind_conf->by_fe);
                free(bind_conf);
        }