Skip to content

Commit 350a3ab

Browse files
committed
BUG/MINOR: deinit: release uri_auth admin rules
When uri_auth admin rules were implemented in 474be41 ("[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.
1 parent df93cf7 commit 350a3ab

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/haproxy.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3284,6 +3284,7 @@ void deinit(void)
32843284

32853285
while (ua) {
32863286
struct stat_scope *scope, *scopep;
3287+
struct stats_admin_rule *rule, *ruleb;
32873288

32883289
uap = ua;
32893290
ua = ua->next;
@@ -3295,6 +3296,11 @@ void deinit(void)
32953296

32963297
userlist_free(uap->userlist);
32973298
free_act_rules(&uap->http_req_rules);
3299+
list_for_each_entry_safe(rule, ruleb, &uap->admin_rules, list) {
3300+
LIST_DELETE(&rule->list);
3301+
free_acl_cond(rule->cond);
3302+
free(rule);
3303+
}
32983304

32993305
scope = uap->scope;
33003306
while (scope) {

0 commit comments

Comments
 (0)