From 5fd9eab20fc48f84c2ab389f91ae11d65361ccf5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 8 Jan 2014 19:46:01 +0100 Subject: s3:lib/tldap: make use of tevent_req_defer_callback() 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 Reviewed-by: Volker Lendecke --- source3/lib/tldap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c index b094c2d3c2..a566a91adb 100644 --- a/source3/lib/tldap.c +++ b/source3/lib/tldap.c @@ -650,6 +650,8 @@ static void tldap_msg_received(struct tevent_req *subreq) 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); -- cgit