From 350a3ab052e94d8b1ce1f526705a352cfd7d451c Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Wed, 13 Nov 2024 18:26:34 +0100 Subject: [PATCH] BUG/MINOR: deinit: release uri_auth admin rules When uri_auth admin rules were implemented in 474be415 ("[MEDIUM] stats: add an admin level") no attempt was made to free the list of allocated rules, which makes valgrind unhappy upon deinit when "stats admin" is used in the config. To fix the issue, let's cleanup the admin rules list upon deinit where uri_auth freeing is already handled. While this could be backported to every stable versions, given how minor this is and has no impact on the dying process, it is probably not worth the effort. --- src/haproxy.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/haproxy.c b/src/haproxy.c index 83cbffcb5..3496ba815 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -3284,6 +3284,7 @@ void deinit(void) while (ua) { struct stat_scope *scope, *scopep; + struct stats_admin_rule *rule, *ruleb; uap = ua; ua = ua->next; @@ -3295,6 +3296,11 @@ void deinit(void) userlist_free(uap->userlist); free_act_rules(&uap->http_req_rules); + list_for_each_entry_safe(rule, ruleb, &uap->admin_rules, list) { + LIST_DELETE(&rule->list); + free_acl_cond(rule->cond); + free(rule); + } scope = uap->scope; while (scope) { -- 2.47.3