summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/providers/ldap/sdap_fd_events.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap_fd_events.c b/src/providers/ldap/sdap_fd_events.c
index c3f9e118..ebec544f 100644
--- a/src/providers/ldap/sdap_fd_events.c
+++ b/src/providers/ldap/sdap_fd_events.c
@@ -38,7 +38,7 @@ int get_fd_from_ldap(LDAP *ldap, int *fd)
int ret;
ret = ldap_get_option(ldap, LDAP_OPT_DESC, fd);
- if (ret != LDAP_OPT_SUCCESS) {
+ if (ret != LDAP_OPT_SUCCESS || *fd < 0) {
DEBUG(1, ("Failed to get fd from ldap!!\n"));
*fd = -1;
return EIO;