summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-11-10 14:43:55 +0100
committerKarolin Seeger <kseeger@samba.org>2012-01-23 21:29:44 +0100
commit5950aa455eab5a5305897eb67a4a1bcfeb10b409 (patch)
tree517766802cb02f908ec0c29efe993d68ee1d09a4 /libcli
parent33b160306c7e79658034465cce2391cf9af90481 (diff)
downloadsamba-5950aa455eab5a5305897eb67a4a1bcfeb10b409.tar.gz
libcli/cldap: fix a crash bug in cldap_socket_recv_dgram() (bug #8593)
After a calling any wrapper of tevent_req_notify_callback(), e.g. tevent_req_nterror(), tevent_req_done(), tevent_req_nomem(), a function has to return immediately otherwise it is very likely to crash. metze (similar to commit 17f1a97a614db4ed8292544988cb6a6cf56621d8) (cherry picked from commit 740a001971bab647c1ab129b3dd2fbccaddc4e7b)
Diffstat (limited to 'libcli')
-rw-r--r--libcli/cldap/cldap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libcli/cldap/cldap.c b/libcli/cldap/cldap.c
index 363ffbd1dc5..aa34a6d6cf4 100644
--- a/libcli/cldap/cldap.c
+++ b/libcli/cldap/cldap.c
@@ -273,12 +273,9 @@ static bool cldap_socket_recv_dgram(struct cldap_socket *c,
DLIST_REMOVE(c->searches.list, search);
- if (!cldap_recvfrom_setup(c)) {
- goto nomem;
- }
+ cldap_recvfrom_setup(c);
tevent_req_done(search->req);
- talloc_free(in);
return true;
nomem:
@@ -286,6 +283,7 @@ nomem:
error:
status = map_nt_error_from_unix(in->recv_errno);
nterror:
+ TALLOC_FREE(in);
/* in connected mode the first pending search gets the error */
if (!c->connected) {
/* otherwise we just ignore the error */
@@ -294,9 +292,11 @@ nterror:
if (!c->searches.list) {
goto done;
}
+ cldap_recvfrom_setup(c);
tevent_req_nterror(c->searches.list->req, status);
+ return true;
done:
- talloc_free(in);
+ TALLOC_FREE(in);
return false;
}