From: Martin Schwenke Date: Tue, 12 Nov 2019 01:14:18 +0000 (+1100) Subject: ctdb-tcp: Simplify freeing of transport data on shutdown X-Git-Tag: talloc-2.3.1~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e45feaf28da27653e9df36c7c50cbd54a792a2aa;p=thirdparty%2Fsamba.git 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 --- 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);