mirror of
http://git.haproxy.org/git/haproxy.git
synced 2026-02-11 09:32:48 +02:00
MINOR: fix a few memory usage errors
These are either use after free errors or small leaks where memory is not free'd after some error state is detected.
This commit is contained in:
committed by
Willy Tarreau
parent
e21f84903e
commit
07fcaaa4cd
@@ -1076,8 +1076,8 @@ int pat_idx_list_reg(struct pattern_expr *expr, struct pattern *pat, char **err)
|
||||
|
||||
/* compile regex */
|
||||
if (!regex_comp(pat->ptr.str, patl->pat.ptr.reg, !(expr->mflags & PAT_MF_IGNORE_CASE), 0, err)) {
|
||||
free(patl);
|
||||
free(patl->pat.ptr.reg);
|
||||
free(patl);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1458,14 +1458,14 @@ int pat_ref_delete(struct pat_ref *ref, const char *key)
|
||||
/* delete pattern from reference */
|
||||
list_for_each_entry_safe(elt, safe, &ref->head, list) {
|
||||
if (strcmp(key, elt->pattern) == 0) {
|
||||
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);
|
||||
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user