summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd Lyons <tlyons@exim.org>2013-10-31 06:04:27 -0700
committerTodd Lyons <tlyons@exim.org>2013-10-31 06:04:27 -0700
commitff2c417d0b970db22a382cb692d066d8fe3c32ae (patch)
treeb63b2b83f812112ba2c56b50c4ace7e84ef0a7bb
parent69aca2feaca1ebbc55c6f1adaee4738dc328ae90 (diff)
Only unbind ldap connection if bind succeeded
-rw-r--r--src/src/lookups/ldap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/src/lookups/ldap.c b/src/src/lookups/ldap.c
index bb29b43af..6129b4bfe 100644
--- a/src/src/lookups/ldap.c
+++ b/src/src/lookups/ldap.c
@@ -1367,7 +1367,8 @@ while ((lcp = ldap_connections) != NULL)
{
DEBUG(D_lookup) debug_printf("unbind LDAP connection to %s:%d\n", lcp->host,
lcp->port);
- ldap_unbind(lcp->ld);
+ if(lcp->bound == TRUE)
+ ldap_unbind(lcp->ld);
ldap_connections = lcp->next;
}
}