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.
This commit is contained in:
Aurelien DARRAGON 2024-11-13 18:26:34 +01:00
parent df93cf72b9
commit 350a3ab052
1 changed files with 6 additions and 0 deletions

View File

@ -3284,6 +3284,7 @@ void deinit(void)
while (ua) { while (ua) {
struct stat_scope *scope, *scopep; struct stat_scope *scope, *scopep;
struct stats_admin_rule *rule, *ruleb;
uap = ua; uap = ua;
ua = ua->next; ua = ua->next;
@ -3295,6 +3296,11 @@ void deinit(void)
userlist_free(uap->userlist); userlist_free(uap->userlist);
free_act_rules(&uap->http_req_rules); 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; scope = uap->scope;
while (scope) { while (scope) {