mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-22 14:49:45 -04:00
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.
This commit is contained in:
parent
a209c35f30
commit
2f6aab9211
1 changed files with 6 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue