Only unbind ldap connection if bind succeeded
authorTodd Lyons <tlyons@exim.org>
Thu, 31 Oct 2013 13:04:27 +0000 (06:04 -0700)
committerTodd Lyons <tlyons@exim.org>
Thu, 31 Oct 2013 13:04:27 +0000 (06:04 -0700)
src/src/lookups/ldap.c

index bb29b43afcae998970e83bd62139b75f8aa5d1c9..6129b4bfeea6b1bf022126ab5bdecd0840fa8f15 100644 (file)
@@ -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;
   }
 }