mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-27 11:52:34 -04:00
BUG/MINOR: sample: fix memory leak in check_when_cond() when ACL is not found
When find_acl_by_name() and find_acl_default() both fail when parsing converter "when(ACL,foo)", the previously allocated acl_sample struct is leaked. Free it before returning 0. This can be backported to stable versions.
This commit is contained in:
parent
eb97e21a8f
commit
a4f27d96c6
1 changed files with 1 additions and 0 deletions
|
|
@ -4114,6 +4114,7 @@ static int check_when_cond(struct arg *args, struct sample_conv *conv,
|
|||
if (!(acl_sample->terms[0].acl = find_acl_by_name(args[1].data.str.area, &curproxy->acl)) &&
|
||||
!(acl_sample->terms[0].acl = find_acl_default(args[1].data.str.area, &curproxy->acl, err, NULL, NULL, 0))) {
|
||||
memprintf(err, "ACL '%s' not found", args[1].data.str.area);
|
||||
free(acl_sample);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue