tests: fix segfault in store test when connection to ctdbd failed.
authorMichael Adam <obnox@samba.org>
Tue, 21 Dec 2010 16:18:03 +0000 (17:18 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 9 Mar 2011 22:21:23 +0000 (23:21 +0100)
tests/src/ctdb_store.c

index e4c4052412ebdad6c6bd1344a038f50daf544cc2..82669b7b6dd784d8037cfa9d26d4922576ccf0f0 100644 (file)
@@ -138,6 +138,11 @@ int main(int argc, const char *argv[])
 
        ctdb = ctdb_cmdline_client(ev);
 
+       if (ctdb == NULL) {
+               printf("failed to connect to ctdb daemon.\n");
+               exit(1);
+       }
+
        /* attach to a specific database */
        ctdb_db = ctdb_attach(ctdb, "test.tdb", false, 0);
        if (!ctdb_db) {