mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
tldap: Only free() ld->pending if "req" is part of it
Best reviewed with "git show -U10". We need to check that "req" is actually the last request that is being freed before freeing the whole array. Bug: https://bugzilla.samba.org/show_bug.cgi?id=14465 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
eb72f887b0
commit
b85dbc9ccf
@ -492,11 +492,6 @@ static void tldap_msg_unset_pending(struct tevent_req *req)
|
||||
|
||||
tevent_req_set_cleanup_fn(req, NULL);
|
||||
|
||||
if (num_pending == 1) {
|
||||
TALLOC_FREE(ld->pending);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i=0; i<num_pending; i++) {
|
||||
if (req == ld->pending[i]) {
|
||||
break;
|
||||
@ -511,6 +506,11 @@ static void tldap_msg_unset_pending(struct tevent_req *req)
|
||||
return;
|
||||
}
|
||||
|
||||
if (num_pending == 1) {
|
||||
TALLOC_FREE(ld->pending);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Remove ourselves from the cli->pending array
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user