mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-24 21:52:17 +00:00
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.
This commit is contained in:
parent
40db4ae8bb
commit
035058e8bf
@ -467,8 +467,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…
Reference in New Issue
Block a user