summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/providers/ldap/sdap_async.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index 09275dd65..f5cc962b3 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -1167,6 +1167,13 @@ sdap_get_generic_ext_send(TALLOC_CTX *memctx,
state->cb_data = cb_data;
state->clientctrls = clientctrls;
+ if (state->sh == NULL || state->sh->ldap == NULL) {
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("Trying LDAP search while not connected.\n"));
+ tevent_req_error(req, EIO);
+ tevent_req_post(req, ev);
+ return req;
+ }
/* Be extra careful and never allow paging for BASE searches,
* even if requested.