mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-26 19:22:57 -04:00
BUG/MINOR: cache: fix memory leak in parse_cache_rule error path
When the filter config (fconf) allocation fails in parse_cache_rule, the previously allocated cache_flt_conf (cconf) and its strdup'd name string are not freed. The error path only freed cconf but not cconf->c.name, causing a memory leak. No backport is needed.
This commit is contained in:
parent
2dfbc311a8
commit
5830cf3ccf
1 changed files with 4 additions and 1 deletions
|
|
@ -1950,7 +1950,10 @@ static int parse_cache_rule(struct proxy *proxy, const char *name, struct act_ru
|
|||
return 1;
|
||||
|
||||
err:
|
||||
free(cconf);
|
||||
if (cconf) {
|
||||
free(cconf->c.name);
|
||||
free(cconf);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue