mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
ctdb-tcp: Use talloc_strdup() instead of repeating logic
The node name is already constructed when the nodes file is loaded, so just copy the node name. Signed-off-by: Martin Schwenke <mschwenke@ddn.com> Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
parent
f36f03172a
commit
2c75bb8687
@ -496,9 +496,7 @@ static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb)
|
||||
goto failed;
|
||||
}
|
||||
|
||||
ctdb->name = talloc_asprintf(ctdb, "%s:%u",
|
||||
ctdb_addr_to_str(ctdb->address),
|
||||
ctdb_addr_to_port(ctdb->address));
|
||||
ctdb->name = talloc_strdup(ctdb, ctdb->nodes[i]->name);
|
||||
if (ctdb->name == NULL) {
|
||||
ctdb_set_error(ctdb, "Out of memory at %s:%d",
|
||||
__FILE__, __LINE__);
|
||||
|
Loading…
x
Reference in New Issue
Block a user