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

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