Fix some valgrind issues.
authorAndrew Bartlett <abartlet@samba.org>
Sat, 29 Mar 2008 00:18:00 +0000 (11:18 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 29 Mar 2008 00:18:00 +0000 (11:18 +1100)
These small changes seem to fix some of the early issues in 'make
valgrindtest'

Previously, the subtree_delete code didn't pass on the timeout,
leaving it uninitialised.

The ldap_server/ldap_backend.c change tidies up the talloc hierarchy a
bit.

Andrew Bartlett

source/dsdb/samdb/ldb_modules/subtree_delete.c
source/ldap_server/ldap_backend.c

index 56ae7b239a2feef296815df152f03b5da6940a56..9c332d2969077eecc786c73880973bae206666d4 100644 (file)
@@ -160,6 +160,12 @@ static int subtree_delete(struct ldb_module *module, struct ldb_request *req)
                return ret;
        }
 
+       ret = ldb_set_timeout_from_prev_req(module->ldb, req, new_req);
+
+       if (ret != LDB_SUCCESS) {
+               return ret;
+       }
+
        ac->search_req = new_req;
        if (req == NULL) {
                ldb_oom(ac->module->ldb);
index 346aacaa99c03d6c9c5b7ffbe046113e5ad3d78e..8b1c3cec693966a804f16ed52ee7ed44ff055961 100644 (file)
@@ -216,9 +216,6 @@ static NTSTATUS ldapsrv_SearchRequest(struct ldapsrv_call *call)
        lreq = talloc(local_ctx, struct ldb_request);
        NT_STATUS_HAVE_NO_MEMORY(lreq);
 
-       res = talloc_zero(local_ctx, struct ldb_result);
-       NT_STATUS_HAVE_NO_MEMORY(res);
-       
        lreq->operation = LDB_SEARCH;
        lreq->op.search.base = basedn;
        lreq->op.search.scope = scope;
@@ -242,6 +239,9 @@ static NTSTATUS ldapsrv_SearchRequest(struct ldapsrv_call *call)
                }
        }
 
+       res = talloc_zero(lreq, struct ldb_result);
+       NT_STATUS_HAVE_NO_MEMORY(res);
+       
        lreq->context = res;
        lreq->callback = ldb_search_default_callback;