BUG/MINOR: server: fix the "server-template" prefix memory leak
authorDragan Dosen <ddosen@haproxy.com>
Wed, 26 Feb 2025 21:56:41 +0000 (22:56 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 28 Feb 2025 15:27:49 +0000 (16:27 +0100)
The srv->tmpl_info.prefix was not freed in srv_free_params().

This could be backported to all stable versions.

(cherry picked from commit 0ae7a5d672f61cd4a949bf081b61857f6bbad476)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

src/server.c

index 7f18dc1..ef8b719 100644 (file)
@@ -3039,6 +3039,7 @@ void srv_free_params(struct server *srv)
                deinit_log_target(srv->log_target);
                free(srv->log_target);
        }
+       free(srv->tmpl_info.prefix);
 
        if (xprt_get(XPRT_SSL) && xprt_get(XPRT_SSL)->destroy_srv)
                xprt_get(XPRT_SSL)->destroy_srv(srv);