diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2011-07-01 07:36:46 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-07-01 08:07:52 -0400 |
commit | a57cca518ba0b1dda8868448e176ab626272c84b (patch) | |
tree | 55420ac1796426a06eb09463e0b428c80fed465a | |
parent | e96c468ed06c3378e2aee6992dabe926d79e1a2d (diff) | |
download | sssd-a57cca518ba0b1dda8868448e176ab626272c84b.tar.gz sssd-a57cca518ba0b1dda8868448e176ab626272c84b.tar.xz sssd-a57cca518ba0b1dda8868448e176ab626272c84b.zip |
Do not attempt to close() a file descriptor < 0
Coverity 10886
-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, " |