diff options
-rw-r--r-- | src/util/sss_ldap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util/sss_ldap.c b/src/util/sss_ldap.c index 9f76870f8..8d6660fab 100644 --- a/src/util/sss_ldap.c +++ b/src/util/sss_ldap.c @@ -359,7 +359,9 @@ struct tevent_req *sss_ldap_init_send(TALLOC_CTX *mem_ctx, return req; fail: - close(state->sd); + if(state->sd >= 0) { + close(state->sd); + } tevent_req_error(req, ret); #else DEBUG(3, ("ldap_init_fd not available, " |