]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-server: Remove duplicate logic
authorMartin Schwenke <mschwenke@ddn.com>
Mon, 30 Sep 2024 02:40:57 +0000 (12:40 +1000)
committerMartin Schwenke <martins@samba.org>
Wed, 6 Nov 2024 23:03:42 +0000 (23:03 +0000)
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 <mschwenke@ddn.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jerry Heyman <jheyman@ddn.com>
ctdb/server/ctdb_takeover.c

index 50bd512d0ef1a5afd0c7f7257ae23cf1b67b19a6..1908c1f1f2606ae240b7e93ee71f07b65b1b1320 100644 (file)
@@ -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 */