mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-23 22:27:01 +00:00
BUG/MEDIUM: pattern: fixup use_after_free in the pat_ref_delete_by_id
I found there is use_after_free bug in the pat_ref_delete_by_id. [wt: it seems this fix must be backported to 1.5 as well]
This commit is contained in:
parent
7e0c9713b4
commit
aede6ddd1f
@ -1540,14 +1540,13 @@ int pat_ref_delete_by_id(struct pat_ref *ref, struct pat_ref_elt *refelt)
|
||||
/* delete pattern from reference */
|
||||
list_for_each_entry_safe(elt, safe, &ref->head, list) {
|
||||
if (elt == refelt) {
|
||||
list_for_each_entry(expr, &ref->pat, list)
|
||||
pattern_delete(expr, elt);
|
||||
|
||||
LIST_DEL(&elt->list);
|
||||
free(elt->sample);
|
||||
free(elt->pattern);
|
||||
free(elt);
|
||||
|
||||
list_for_each_entry(expr, &ref->pat, list)
|
||||
pattern_delete(expr, elt);
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user