summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-07-01 07:36:46 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-09-20 11:29:53 -0400
commitf81534801bec96ab37ffbc8395e5db09fbd9530d (patch)
tree5bc96e6854484dbca869c4981404afb7f0d01c96
parent6d8ea8acb93c1b668e5fcb1f553546e14a41b09f (diff)
downloadsssd_unused-f81534801bec96ab37ffbc8395e5db09fbd9530d.tar.gz
sssd_unused-f81534801bec96ab37ffbc8395e5db09fbd9530d.tar.xz
sssd_unused-f81534801bec96ab37ffbc8395e5db09fbd9530d.zip
Do not attempt to close() a file descriptor < 0sssd-1.5.1-52.el6
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 84288a90..ddaf9b68 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, "