BUG/MINOR: haproxy: free init_env in deinit only if allocated
This fixes 7b78e1571
(" MINOR: mworker: restore initial env before wait
mode").
In cases, when haproxy starts without any configuration, for example:
'haproxy -vv', init_env array to backup env variables is never allocated. So,
we need to check in deinit(), when we free its memory, that init_env is not a
NULL ptr.
This commit is contained in:
parent
7b78e1571b
commit
28ca7fc594
|
@ -2863,11 +2863,13 @@ void deinit(void)
|
|||
deinit_pollers();
|
||||
|
||||
/* free env variables backup */
|
||||
while (*tmp) {
|
||||
free(*tmp);
|
||||
tmp++;
|
||||
if (init_env) {
|
||||
while (*tmp) {
|
||||
free(*tmp);
|
||||
tmp++;
|
||||
}
|
||||
free(init_env);
|
||||
}
|
||||
free(init_env);
|
||||
|
||||
} /* end deinit() */
|
||||
|
||||
|
|
Loading…
Reference in New Issue