From f81534801bec96ab37ffbc8395e5db09fbd9530d Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Fri, 1 Jul 2011 07:36:46 -0400 Subject: Do not attempt to close() a file descriptor < 0 Coverity 10886 --- src/util/sss_ldap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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, " -- cgit