diff options
author | Swen Schillig <swen@vnet.ibm.com> | 2018-02-20 17:08:59 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2018-03-31 00:07:18 +0200 |
commit | b40bcb094d6aae00cae1b64a25ad3cdb39208449 (patch) | |
tree | 2168c260306156db2d692700ead6c3d1b8c6c753 /ctdb/server/ctdb_call.c | |
parent | 3269cd67078ec28d72168e1a98ef4329243ffa7e (diff) | |
download | samba-b40bcb094d6aae00cae1b64a25ad3cdb39208449.tar.gz |
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>
Diffstat (limited to 'ctdb/server/ctdb_call.c')
-rw-r--r-- | ctdb/server/ctdb_call.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c index 836d615d3c2..ee16a075a69 100644 --- a/ctdb/server/ctdb_call.c +++ b/ctdb/server/ctdb_call.c @@ -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; |