In tldap_msg_received() we call tevent_req_error() for more than
one request, if we do that we need to use tevent_req_defer_callback()
otherwise we're likely to crash, as a triggered callback may
invalidate our state.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
fail:
while (talloc_array_length(ld->pending) > 0) {
req = ld->pending[0];
+ state = tevent_req_data(req, struct tldap_msg_state);
+ tevent_req_defer_callback(req, state->ev);
talloc_set_destructor(req, NULL);
tldap_msg_destructor(req);
tevent_req_error(req, status);