ctdb-recoverd: Simplify using TALLOC_FREE()
authorMartin Schwenke <martin@meltin.net>
Fri, 23 Oct 2015 05:03:38 +0000 (16:03 +1100)
committerAmitay Isaacs <amitay@samba.org>
Thu, 12 Nov 2015 05:24:15 +0000 (06:24 +0100)
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/server/ctdb_recoverd.c

index 66786f30e4e421043cf53ff96c3ea76301c147d5..fd134f9ca65fe2bafb08101aeedcfea6488de09c 100644 (file)
@@ -1586,14 +1586,8 @@ static int ctdb_reload_remote_public_ips(struct ctdb_context *ctdb,
                struct ctdb_node *node = ctdb->nodes[j];
 
                /* release any existing data */
-               if (node->known_public_ips) {
-                       talloc_free(node->known_public_ips);
-                       node->known_public_ips = NULL;
-               }
-               if (node->available_public_ips) {
-                       talloc_free(node->available_public_ips);
-                       node->available_public_ips = NULL;
-               }
+               TALLOC_FREE(node->known_public_ips);
+               TALLOC_FREE(node->available_public_ips);
 
                if (nodemap->nodes[j].flags & NODE_FLAGS_INACTIVE) {
                        continue;
@@ -2527,8 +2521,7 @@ static void election_send_request(struct tevent_context *ev,
                DEBUG(DEBUG_ERR,("Failed to send election request!\n"));
        }
 
-       talloc_free(rec->send_election_te);
-       rec->send_election_te = NULL;
+       TALLOC_FREE(rec->send_election_te);
 }
 
 /*