mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-11 22:15:14 +00:00
Revert "BUG/MINOR: vars: Fix memory leak in vars_check_arg"
This reverts commit 6ea00195c4
.
As found by Christopher, this fix is not correct due to the way args
are built at various places. For example some config or runtime parsers
will place a substring pointer there, and calling free() on it will
immediately crash the program. A quick audit of the code shows that
there are not that many users, but the way it's done requires to
properly set the string as a regular chunk (size=0 if free not desired,
then call chunk_destroy() at release time), and given that the size is
currently set to len+1 in all parsers, a deeper audit needs to be done
to figure the impacts of not setting it anymore.
Thus for now better leave this harmless leak which impacts only the
config parsing time.
This fix must be backported to all branches containing the fix above.
This commit is contained in:
parent
4087346dab
commit
f7b0523425
@ -510,8 +510,6 @@ int vars_check_arg(struct arg *arg, char **err)
|
||||
err);
|
||||
if (!name)
|
||||
return 0;
|
||||
free(arg->data.str.area);
|
||||
arg->data.str.area = NULL;
|
||||
|
||||
/* Use the global variable name pointer. */
|
||||
arg->type = ARGT_VAR;
|
||||
|
Loading…
Reference in New Issue
Block a user