summaryrefslogtreecommitdiff
path: root/source3/lib/tldap.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2017-01-27 16:03:03 +0100
committerJeremy Allison <jra@samba.org>2017-03-18 05:05:24 +0100
commit649deb63c5a2b034ff45bdafc9c8ef64535821f0 (patch)
tree927114136b77953cd8a32576cd87e9f8c434629c /source3/lib/tldap.c
parentad758cb869ac83534993caa212abc9fe9905ec68 (diff)
downloadsamba-649deb63c5a2b034ff45bdafc9c8ef64535821f0.tar.gz
tldap: Allow dropping messages in tldap_search()
For probing whether a connection is a live a rootdse search might be interesting where we don't really care for the result, only success or failure of the operation. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/lib/tldap.c')
-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;