mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-24 07:37:53 -04:00
BUG/MINOR: mworker: use after free when the PID not assigned
Commit 4528611 ("MEDIUM: mworker: store the leaving state of a process")
introduced a bug in the mworker_env_to_proc_list() function.
This is very unlikely to occur since the PID should always be assigned.
It can probably happen if the environment variable is corrupted.
No backport needed.
This commit is contained in:
parent
f983d00a1c
commit
920fc8bbe4
1 changed files with 3 additions and 2 deletions
|
|
@ -180,14 +180,15 @@ void mworker_env_to_proc_list()
|
|||
}
|
||||
}
|
||||
if (child->pid) {
|
||||
/* this is a process inherited from a reload that should be leaving */
|
||||
child->options |= PROC_O_LEAVING;
|
||||
|
||||
LIST_ADDQ(&proc_list, &child->list);
|
||||
} else {
|
||||
free(child->id);
|
||||
free(child);
|
||||
|
||||
}
|
||||
/* this is a process inherited from a reload that should be leaving */
|
||||
child->options |= PROC_O_LEAVING;
|
||||
}
|
||||
|
||||
unsetenv("HAPROXY_PROCESSES");
|
||||
|
|
|
|||
Loading…
Reference in a new issue