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)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 21 Sep 2011 01:42:19 +0000 (11:42 +1000)
cant talloc off vnn since it is not yet initialized and might not always be NULL

server/ctdb_takeover.c

index 4114b40f83e0ccb76da575a39d3e1a1ed8d70761..29f7acd5b7e95aaea26ee821d9d658bcc6b5a641 100644 (file)
@@ -880,15 +880,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) {