s4-ildap: two more places that need talloc_reparent()
authorAndrew Tridgell <tridge@samba.org>
Mon, 27 Sep 2010 22:03:44 +0000 (15:03 -0700)
committerAndrew Tridgell <tridge@samba.org>
Tue, 28 Sep 2010 00:04:03 +0000 (00:04 +0000)
these contexts can have references

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue Sep 28 00:04:03 UTC 2010 on sn-devel-104

source4/lib/ldb/ldb_ildap/ldb_ildap.c
source4/libcli/ldap/ldap_bind.c

index 044f91b3a39969cfec0675a4b3bfd7bb59d98418..98e98a8c794d0950e1b2a7911a5a384191084c77 100644 (file)
@@ -409,7 +409,7 @@ static int ildb_request_send(struct ildb_context *ac, struct ldap_message *msg)
                ldb_set_errstring(ldb, "async send request failed");
                return LDB_ERR_OPERATIONS_ERROR;
        }
-       ac->ireq = talloc_steal(ac, req);
+       ac->ireq = talloc_reparent(ac->ildb->ldap, ac, req);
 
        if (!ac->ireq->conn) {
                ldb_set_errstring(ldb, "connection to remote LDAP server dropped?");
index 5a2635ac0b682a7f583c3d4d6000d9be5f482984..65659794c5135d87f8ba85005901f0bbd90c5576 100644 (file)
@@ -352,7 +352,7 @@ _PUBLIC_ NTSTATUS ldap_bind_sasl(struct ldap_connection *conn,
                        status = NT_STATUS_NO_MEMORY;
                        goto failed;
                }
-               talloc_steal(tmp_ctx, req);
+               talloc_reparent(conn, tmp_ctx, req);
 
                status = ldap_result_n(req, 0, &response);
                if (!NT_STATUS_IS_OK(status)) {