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>
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;
DLIST_ADD(ctdb_db->pending_calls, state);
+ talloc_set_destructor(state, ctdb_call_destructor);
ctdb_queue_packet(ctdb, &state->c->hdr);
return state;