From: Martin Schwenke Date: Mon, 30 Sep 2024 02:40:57 +0000 (+1000) Subject: ctdb-server: Remove duplicate logic X-Git-Tag: tdb-1.4.13~631 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=762f5f5ca6350cc0b93c71f06abc963e13793e0e;p=thirdparty%2Fsamba.git ctdb-server: Remove duplicate logic Initialise the pointer to NULL and fall through to let talloc_realloc() do the allocation. talloc_realloc() does the right thing with a NULL pointer... Signed-off-by: Martin Schwenke Reviewed-by: Volker Lendecke Reviewed-by: Jerry Heyman --- diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c index 50bd512d0ef..1908c1f1f26 100644 --- a/ctdb/server/ctdb_takeover.c +++ b/ctdb/server/ctdb_takeover.c @@ -1560,18 +1560,7 @@ int32_t ctdb_control_tcp_add(struct ctdb_context *ctdb, vnn->tcp_array = tcparray; tcparray->num = 0; - tcparray->connections = talloc_size(tcparray, - sizeof(struct ctdb_connection)); - CTDB_NO_MEMORY(ctdb, tcparray->connections); - - tcparray->connections[tcparray->num].src = p->src; - tcparray->connections[tcparray->num].dst = p->dst; - tcparray->num++; - - if (tcp_update_needed) { - vnn->tcp_update_needed = true; - } - return 0; + tcparray->connections = NULL; } /* A new tickle, we must add it to the array */