summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-07-01 07:36:46 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-10-26 10:29:39 -0400
commit62ada364bee87a0a910490f174e974c19b330791 (patch)
treecf240e989caa0808b2ad5d0003dedd1656b7d1bd
parent7b997edf7700aa7b46e2ea7fe6475f67e04e1f9c (diff)
downloadsssd-62ada364bee87a0a910490f174e974c19b330791.tar.gz
sssd-62ada364bee87a0a910490f174e974c19b330791.tar.xz
sssd-62ada364bee87a0a910490f174e974c19b330791.zip
Do not attempt to close() a file descriptor < 0
Coverity 10886
-rw-r--r--src/util/sss_ldap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util/sss_ldap.c b/src/util/sss_ldap.c
index 84288a903..ddaf9b686 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, "