summaryrefslogtreecommitdiffstats
path: root/source3/lib/tldap.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-01-08 19:46:01 +0100
committerStefan Metzmacher <metze@samba.org>2014-01-17 12:38:09 +0100
commit5fd9eab20fc48f84c2ab389f91ae11d65361ccf5 (patch)
tree913ad9e00896d191fe5dc3f1f53e1a7827e80529 /source3/lib/tldap.c
parentc84fe17ba954d2784cc1ac5f9e1f3a8302ca951d (diff)
downloadsamba-5fd9eab20fc48f84c2ab389f91ae11d65361ccf5.tar.gz
samba-5fd9eab20fc48f84c2ab389f91ae11d65361ccf5.tar.xz
samba-5fd9eab20fc48f84c2ab389f91ae11d65361ccf5.zip
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 <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3/lib/tldap.c')
-rw-r--r--source3/lib/tldap.c2
1 files changed, 2 insertions, 0 deletions
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);