]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: server: add missing free for server->rdr_pfx
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 14 Sep 2023 22:42:55 +0000 (00:42 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 15 Sep 2023 15:46:49 +0000 (17:46 +0200)
rdr_pfx was not being free during server cleanup, leading to small memory
leak when "redir" argument was used on a server line (HTTP only).

This should be backported to every stable versions.

[For 2.6 and 2.7: the free should be performed in srv_drop() directly.
 For older versions: free in deinit() function near the free for the
 cookie string]

src/server.c

index 3673340d155a6af726400c0b72f805a4465d5a10..17e911da39fb43739390ef011f4112a9b77be3ac 100644 (file)
@@ -2471,6 +2471,7 @@ void srv_take(struct server *srv)
 void srv_free_params(struct server *srv)
 {
        free(srv->cookie);
+       free(srv->rdr_pfx);
        free(srv->hostname);
        free(srv->hostname_dn);
        free((char*)srv->conf.file);