mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 04:31:49 +02: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
@ -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…
x
Reference in New Issue
Block a user