ctdb-tcp: Simplify freeing of transport data on shutdown
authorMartin Schwenke <martin@meltin.net>
Tue, 12 Nov 2019 01:14:18 +0000 (12:14 +1100)
committerAmitay Isaacs <amitay@samba.org>
Thu, 14 Nov 2019 03:45:44 +0000 (03:45 +0000)
The type-checking is superfluous and gets in the way of readability.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Nov 14 03:45:44 UTC 2019 on sn-devel-184

ctdb/tcp/tcp_init.c

index 5bd9e2f3a09d51c7d02bbdc36b8c4ff979fa9975..559ad8691d03ecbb0c5cedd749e56468eee8a01f 100644 (file)
@@ -135,12 +135,9 @@ static void ctdb_tcp_restart(struct ctdb_node *node)
 */
 static void ctdb_tcp_shutdown(struct ctdb_context *ctdb)
 {
-       struct ctdb_tcp *ctcp = talloc_get_type(ctdb->transport_data,
-                                               struct ctdb_tcp);
        uint32_t i;
 
-       talloc_free(ctcp);
-       ctdb->transport_data = NULL;
+       TALLOC_FREE(ctdb->transport_data);
 
        for (i=0; i<ctdb->num_nodes; i++) {
                TALLOC_FREE(ctdb->nodes[i]->transport_data);