From: Willy Tarreau Date: Mon, 21 Sep 2015 13:24:58 +0000 (+0200) Subject: BUG/MAJOR: peers: fix a crash when stopping peers on unbound processes X-Git-Tag: v1.6-dev6~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=37bb7be09cfd966ea4cc0397bdb89eccd4a67dcc;p=thirdparty%2Fhaproxy.git BUG/MAJOR: peers: fix a crash when stopping peers on unbound processes Pradeep Jindal reported and troubleshooted a bug causing haproxy to die during startup on all processes not making use of a peers section. It only happens with nbproc > 1 when peers are declared. Technically it's when the peers task is stopped on processes that don't use it that the crash occurred (a task_free() called on a NULL task pointer). This only affects peers v2 in the dev branch, no backport is needed. --- diff --git a/src/peers.c b/src/peers.c index f628a7f36c..a40591831f 100644 --- a/src/peers.c +++ b/src/peers.c @@ -1765,9 +1765,9 @@ static struct task *process_peer_sync(struct task * task) if (!peers->peers_fe) { /* this one was never started, kill it */ signal_unregister_handler(peers->sighandler); - peers->sync_task = NULL; task_delete(peers->sync_task); task_free(peers->sync_task); + peers->sync_task = NULL; return NULL; }