summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-07-01 07:36:46 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-07-01 08:07:46 -0400
commitd6a3efc22e51bd26b16caad95a6eaabf55e67a69 (patch)
treed25f6e8f328912ce7a62b12415b5fd6443208375 /src
parent6b95ac33d33d7d9ff643f3e5c2d4ec27afa5e13c (diff)
downloadsssd-d6a3efc22e51bd26b16caad95a6eaabf55e67a69.tar.gz
sssd-d6a3efc22e51bd26b16caad95a6eaabf55e67a69.tar.xz
sssd-d6a3efc22e51bd26b16caad95a6eaabf55e67a69.zip
Do not attempt to close() a file descriptor < 0
Coverity 10886
Diffstat (limited to 'src')
-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 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, "