ctdb: fix crash on "ctdb scriptstatus --events=releaseip"
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 12 Jul 2010 06:38:37 +0000 (16:08 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Mon, 12 Jul 2010 06:38:37 +0000 (16:08 +0930)
Martin accidentally typed this instead of "ctdb scriptstatus releaseip"
and it crashes.

CQ:S1018859
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
tools/ctdb.c

index 972a36716553c12d1f7c8b0e2ea8059b3945a49a..4b81df7a2ad20d5734970b9cbd679e32bd1b6089 100644 (file)
@@ -4551,6 +4551,10 @@ int main(int argc, const char *argv[])
        control = extra_argv[0];
 
        ev = event_context_init(NULL);
+       if (!ev) {
+               DEBUG(DEBUG_ERR, ("Failed to initialize event system\n"));
+               exit(1);
+       }
 
        for (i=0;i<ARRAY_SIZE(ctdb_commands);i++) {
                if (strcmp(control, ctdb_commands[i].name) == 0) {