BUG/MEDIUM: mworker: fix segv in early failure of mworker mode with peers
During an early failure of the mworker mode, the mworker_cleanlisteners() function is called and tries to cleanup the peers, however the peers are in a semi-initialized state and will use NULL pointers. The fix check the variable before trying to use them. Bug revealed in issue #1956. Could be backported as far as 2.0. (cherry picked from commit 035058e8bfe4fc731b2ede8fcdc2b8d14c4936ce) Signed-off-by: Christopher Faulet <cfaulet@haproxy.com> (cherry picked from commit 661557989e3a8d84d18c997ebdabb26146ebe8ad) Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
This commit is contained in:
parent
06dc13be6b
commit
360b26a15d
@ -462,8 +462,10 @@ void mworker_cleanlisteners()
|
||||
|
||||
stop_proxy(curpeers->peers_fe);
|
||||
/* disable this peer section so that it kills itself */
|
||||
signal_unregister_handler(curpeers->sighandler);
|
||||
task_destroy(curpeers->sync_task);
|
||||
if (curpeers->sighandler)
|
||||
signal_unregister_handler(curpeers->sighandler);
|
||||
if (curpeers->sync_task)
|
||||
task_destroy(curpeers->sync_task);
|
||||
curpeers->sync_task = NULL;
|
||||
task_destroy(curpeers->peers_fe->task);
|
||||
curpeers->peers_fe->task = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user