From: Amaury Denoyelle Date: Wed, 14 Jan 2026 10:19:13 +0000 (+0100) Subject: BUG/MINOR: proxy: free persist_rules X-Git-Tag: v3.4-dev3~50 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f6aab9211ff05d637e93a82e0f868ef31ce8e17;p=thirdparty%2Fhaproxy.git BUG/MINOR: proxy: free persist_rules force-persist proxy keyword is converted into a persist_rule, stored in proxy persist_rules list member. Each new rule is dynamically allocated during parsing. This commit fixes the memory leak on deinit due to a missing free on persist_rules list entries. This is done via deinit_proxy() modification. Each rule in the list is freed, along with its associated ACL condition type. This can be backported to every stable version. --- diff --git a/src/proxy.c b/src/proxy.c index f7c8a6c9e..bdfe0e76f 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -320,6 +320,12 @@ void deinit_proxy(struct proxy *p) EXTRA_COUNTERS_FREE(p->extra_counters_fe); EXTRA_COUNTERS_FREE(p->extra_counters_be); + list_for_each_entry_safe(rule, ruleb, &p->persist_rules, list) { + LIST_DELETE(&rule->list); + free_acl_cond(rule->cond); + free(rule); + } + free_server_rules(&p->server_rules); list_for_each_entry_safe(rule, ruleb, &p->switching_rules, list) {