tldap: avoid more use after free errors
authorRalph Boehme <slow@samba.org>
Tue, 5 Feb 2019 13:08:56 +0000 (14:08 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 6 Feb 2019 09:19:12 +0000 (10:19 +0100)
See the previous commit for an explanation. :)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13776

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Wed Feb  6 10:19:12 CET 2019 on sn-devel-144

source3/lib/tldap_util.c

index 508c6c02f804518fd1bbfa505f2048cdacb16c71..54a9eb30bbebc8526a6919feb89b417aa3bbd4e1 100644 (file)
@@ -457,7 +457,6 @@ static void tldap_fetch_rootdse_done(struct tevent_req *subreq)
 
        rc = tldap_search_recv(subreq, state, &msg);
        if (tevent_req_ldap_error(req, rc)) {
 
        rc = tldap_search_recv(subreq, state, &msg);
        if (tevent_req_ldap_error(req, rc)) {
-               TALLOC_FREE(subreq);
                return;
        }
 
                return;
        }
 
@@ -739,7 +738,6 @@ static void tldap_search_paged_done(struct tevent_req *subreq)
 
        rc = tldap_search_recv(subreq, state, &state->result);
        if (tevent_req_ldap_error(req, rc)) {
 
        rc = tldap_search_recv(subreq, state, &state->result);
        if (tevent_req_ldap_error(req, rc)) {
-               TALLOC_FREE(subreq);
                return;
        }
 
                return;
        }