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>
(cherry picked from commit 360b26a15dca2f1c01007b08a67dec7f062e80d4)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 352e6a4501cf36c3fdad1e0af0754fa3f766d7d7)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed