mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-12 08:27:24 +00:00
BUG/MINOR: pattern: Avoid memory leak on out-of-memory condition
pattern_new_expr() failed to free the allocated list element when an out-of-memory error occurs during initialization of the element. As this only happens when loading the configuration file or evaluating commands via the CLI, it is unlikely for this leak to be relevant unless the user makes automated, heavy use of the CLI. Found in HAProxy 1.5.14.
This commit is contained in:
parent
93f91c3082
commit
e6e22e8e90
@ -2063,6 +2063,7 @@ struct pattern_expr *pattern_new_expr(struct pattern_head *head, struct pat_ref
|
||||
/* Get a lot of memory for the expr struct. */
|
||||
expr = malloc(sizeof(*expr));
|
||||
if (!expr) {
|
||||
free(list);
|
||||
memprintf(err, "out of memory");
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user