From: Vincent Bernat Date: Thu, 1 Oct 2009 04:49:57 +0000 (+0200) Subject: Fix a segfault happening when there is no real server for a virtual server. X-Git-Tag: v1.1.19~3 X-Git-Url: http://git.formilux.org/?a=commitdiff_plain;h=f146920efd383e3b93a43153be8f8243d9490bc9;p=people%2Falex%2Fkeepalived.git Fix a segfault happening when there is no real server for a virtual server. This bug was introduced in 1.1.18 with the quorum fix patch: I forgot to use braces and therefore, init_service_rs() was called unconditionaly, including when vs->rs list is empty. --- diff --git a/keepalived/check/ipwrapper.c b/keepalived/check/ipwrapper.c index 953fd28..6475bad 100644 --- a/keepalived/check/ipwrapper.c +++ b/keepalived/check/ipwrapper.c @@ -206,11 +206,12 @@ init_service_vs(virtual_server * vs) } /* Processing real server queue */ - if (!LIST_ISEMPTY(vs->rs)) + if (!LIST_ISEMPTY(vs->rs)) { if (vs->alpha) vs->quorum_state = DOWN; if (!init_service_rs(vs)) return 0; + } return 1; }