ctdb-daemon: Drop some uses of CTDB_NO_MEMORY{,_FATAL}()
authorMartin Schwenke <martin@meltin.net>
Wed, 24 Aug 2016 06:49:30 +0000 (16:49 +1000)
committerAmitay Isaacs <amitay@samba.org>
Thu, 8 Sep 2016 04:57:20 +0000 (06:57 +0200)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_takeover.c

index 3b2488bd4fae6e835154d56ce1acf605d5326972..786eb3c4dbbc3035818e9359abc9651bcf15577a 100644 (file)
@@ -116,9 +116,16 @@ static int ctdb_add_local_iface(struct ctdb_context *ctdb, const char *iface)
 
        /* create a new structure for this interface */
        i = talloc_zero(ctdb, struct ctdb_interface);
-       CTDB_NO_MEMORY_FATAL(ctdb, i);
+       if (i == NULL) {
+               DEBUG(DEBUG_ERR, (__location__ " out of memory\n"));
+               return -1;
+       }
        i->name = talloc_strdup(i, iface);
-       CTDB_NO_MEMORY(ctdb, i->name);
+       if (i->name == NULL) {
+               DEBUG(DEBUG_ERR, (__location__ " out of memory\n"));
+               talloc_free(i);
+               return -1;
+       }
 
        i->link_up = true;