summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/tldap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c
index 5fcb43c29f4..40064fdeeed 100644
--- a/source3/lib/tldap.c
+++ b/source3/lib/tldap.c
@@ -1995,7 +1995,7 @@ TLDAPRC tldap_search(struct tldap_context *ld,
rc = TLDAP_OPERATIONS_ERROR;
goto fail;
}
- rc = tldap_search_all_recv(req, mem_ctx, &msgs, &result);
+ rc = tldap_search_all_recv(req, frame, &msgs, &result);
TALLOC_FREE(req);
if (!TLDAP_RC_IS_SUCCESS(rc)) {
goto fail;
@@ -2004,7 +2004,9 @@ TLDAPRC tldap_search(struct tldap_context *ld,
TALLOC_FREE(ld->last_msg);
ld->last_msg = talloc_move(ld, &result);
- *pmsgs = msgs;
+ if (pmsgs != NULL) {
+ *pmsgs = talloc_move(mem_ctx, &msgs);
+ }
fail:
TALLOC_FREE(frame);
return rc;