Fix a segfault happening when there is no real server for a virtual server.
authorVincent Bernat <bernat@luffy.cx>
Thu, 1 Oct 2009 04:49:57 +0000 (06:49 +0200)
committerAlexandre Cassen <acassen@freebox.fr>
Thu, 1 Oct 2009 07:47:46 +0000 (09:47 +0200)
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.

keepalived/check/ipwrapper.c

index 953fd28..6475bad 100644 (file)
@@ -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;
 }