mirror of
https://github.com/samba-team/samba.git
synced 2025-03-26 18:50:30 +03:00
ctdb-server: Only talloc_set_destructor when required
The destructor is only needed once the state got added to the DLIST. Therefore, move the setting of the destructor to after the addition of state to the DLIST. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Reviewed-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
3269cd6707
commit
b40bcb094d
@ -1478,8 +1478,6 @@ struct ctdb_call_state *ctdb_daemon_call_send_remote(struct ctdb_db_context *ctd
|
||||
|
||||
state->reqid = reqid_new(ctdb->idr, state);
|
||||
state->ctdb_db = ctdb_db;
|
||||
talloc_set_destructor(state, ctdb_call_destructor);
|
||||
|
||||
state->state = CTDB_CALL_WAIT;
|
||||
state->generation = ctdb_db->generation;
|
||||
|
||||
@ -1516,6 +1514,7 @@ struct ctdb_call_state *ctdb_daemon_call_send_remote(struct ctdb_db_context *ctd
|
||||
|
||||
DLIST_ADD(ctdb_db->pending_calls, state);
|
||||
|
||||
talloc_set_destructor(state, ctdb_call_destructor);
|
||||
ctdb_queue_packet(ctdb, &state->c->hdr);
|
||||
|
||||
return state;
|
||||
|
Loading…
x
Reference in New Issue
Block a user