mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-02 10:12:03 +00:00
BUG/MINOR: haproxy: Free srule->expr during deinit
Given the following example configuration: backend foo mode http use-server %[str(x)] if { always_true } server x example.com:80 Running a configuration check with valgrind reports: ==19376== 170 (40 direct, 130 indirect) bytes in 1 blocks are definitely lost in loss record 281 of 347 ==19376== at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==19376== by 0x5091AC: add_sample_to_logformat_list (log.c:511) ==19376== by 0x50A5A6: parse_logformat_string (log.c:671) ==19376== by 0x4957F2: check_config_validity (cfgparse.c:2588) ==19376== by 0x54442D: init (haproxy.c:2129) ==19376== by 0x421E42: main (haproxy.c:3169) After this patch is applied the leak is gone as expected. This is a very minor leak that can only be observed if deinit() is called, shortly before the OS will free all memory of the process anyway. No backport needed.
This commit is contained in:
parent
6fb74a1dc3
commit
826cf0729b
@ -2666,6 +2666,12 @@ void deinit(void)
|
||||
list_for_each_entry_safe(srule, sruleb, &p->server_rules, list) {
|
||||
LIST_DEL(&srule->list);
|
||||
prune_acl_cond(srule->cond);
|
||||
list_for_each_entry_safe(lf, lfb, &srule->expr, list) {
|
||||
LIST_DEL(&lf->list);
|
||||
release_sample_expr(lf->expr);
|
||||
free(lf->arg);
|
||||
free(lf);
|
||||
}
|
||||
free(srule->file);
|
||||
free(srule->cond);
|
||||
free(srule);
|
||||
|
Loading…
Reference in New Issue
Block a user