From ff2c417d0b970db22a382cb692d066d8fe3c32ae Mon Sep 17 00:00:00 2001 From: Todd Lyons Date: Thu, 31 Oct 2013 06:04:27 -0700 Subject: [PATCH 1/1] Only unbind ldap connection if bind succeeded --- src/src/lookups/ldap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } } -- 2.30.2