From e45feaf28da27653e9df36c7c50cbd54a792a2aa Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Tue, 12 Nov 2019 12:14:18 +1100 Subject: [PATCH] ctdb-tcp: Simplify freeing of transport data on shutdown The type-checking is superfluous and gets in the way of readability. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Amitay Isaacs Autobuild-Date(master): Thu Nov 14 03:45:44 UTC 2019 on sn-devel-184 --- ctdb/tcp/tcp_init.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ctdb/tcp/tcp_init.c b/ctdb/tcp/tcp_init.c index 5bd9e2f3a09..559ad8691d0 100644 --- a/ctdb/tcp/tcp_init.c +++ b/ctdb/tcp/tcp_init.c @@ -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; inum_nodes; i++) { TALLOC_FREE(ctdb->nodes[i]->transport_data); -- 2.47.3