summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_ldap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 04929314f0..7d66b0aaf0 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -3423,7 +3423,8 @@ static BOOL ldapsam_search_firstpage(struct pdb_search *search)
state->connection->paged_results = False;
}
- state->current_entry = ldap_first_entry(ld, state->entries);
+ if ( ld )
+ state->current_entry = ldap_first_entry(ld, state->entries);
if (state->current_entry == NULL) {
ldap_msgfree(state->entries);