mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-22 23:02:34 -04:00
CLEANUP: cfgparse: replace "realloc" with "my_realloc2" to fix to memory leak on error
my_realloc2 frees variable in case of allocation failure.
fixes #1030
realloc was introduced in 9e1758efbd
this might be backported to 2.2, 2.3
This commit is contained in:
parent
3bad3d5ee6
commit
76837bc948
1 changed files with 1 additions and 1 deletions
|
|
@ -1983,7 +1983,7 @@ next_line:
|
|||
|
||||
if (err & (PARSE_ERR_TOOLARGE|PARSE_ERR_OVERLAP)) {
|
||||
outlinesize = (outlen + 1023) & -1024;
|
||||
outline = realloc(outline, outlinesize);
|
||||
outline = my_realloc2(outline, outlinesize);
|
||||
if (outline == NULL) {
|
||||
ha_alert("parsing [%s:%d]: line too long, cannot allocate memory.\n",
|
||||
file, linenum);
|
||||
|
|
|
|||
Loading…
Reference in a new issue