when checking that the interfaces exist in ctdb_add_public_address()
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 21 Sep 2011 01:42:19 +0000 (11:42 +1000)
committerMichael Adam <obnox@samba.org>
Fri, 6 Jun 2014 13:00:40 +0000 (15:00 +0200)
cant talloc off vnn since it is not yet initialized and might not always be NULL
(cherry picked from commit 3d37be3e2bfb61ede824028aeebaa18ba304faae)

server/ctdb_takeover.c

index 19ed670989c663a5f3236694364ab4da76f34bcb..56c759954002034cdc42b7fe9a99f5938a0816cd 100644 (file)
@@ -959,15 +959,15 @@ static int ctdb_add_public_address(struct ctdb_context *ctdb,
        int i;
        int ret;
 
-       tmp = talloc_strdup(vnn, ifaces);
+       tmp = strdup(ifaces);
        for (iface = strtok(tmp, ","); iface; iface = strtok(NULL, ",")) {
                if (!ctdb_sys_check_iface_exists(iface)) {
                        DEBUG(DEBUG_CRIT,("Interface %s does not exist. Can not add public-address : %s\n", iface, ctdb_addr_to_str(addr)));
-                       talloc_free(tmp);
+                       free(tmp);
                        return -1;
                }
        }
-       talloc_free(tmp);
+       free(tmp);
 
        /* Verify that we dont have an entry for this ip yet */
        for (vnn=ctdb->vnn;vnn;vnn=vnn->next) {