mirror of
https://github.com/samba-team/samba.git
synced 2025-01-03 01:18:10 +03:00
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 <mschwenke@ddn.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jerry Heyman <jheyman@ddn.com>
This commit is contained in:
parent
5af8627feb
commit
762f5f5ca6
@ -1560,18 +1560,7 @@ int32_t ctdb_control_tcp_add(struct ctdb_context *ctdb,
|
|||||||
vnn->tcp_array = tcparray;
|
vnn->tcp_array = tcparray;
|
||||||
|
|
||||||
tcparray->num = 0;
|
tcparray->num = 0;
|
||||||
tcparray->connections = talloc_size(tcparray,
|
tcparray->connections = NULL;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A new tickle, we must add it to the array */
|
/* A new tickle, we must add it to the array */
|
||||||
|
Loading…
Reference in New Issue
Block a user