[exim-cvs] Only unbind ldap connection if bind succeeded

Top Pagina
Delete this message
Reply to this message
Auteur: Exim Git Commits Mailing List
Datum:  
Aan: exim-cvs
Onderwerp: [exim-cvs] Only unbind ldap connection if bind succeeded
Gitweb: http://git.exim.org/exim.git/commitdiff/ff2c417d0b970db22a382cb692d066d8fe3c32ae
Commit:     ff2c417d0b970db22a382cb692d066d8fe3c32ae
Parent:     69aca2feaca1ebbc55c6f1adaee4738dc328ae90
Author:     Todd Lyons <tlyons@???>
AuthorDate: Thu Oct 31 06:04:27 2013 -0700
Committer:  Todd Lyons <tlyons@???>
CommitDate: Thu Oct 31 06:04:27 2013 -0700


    Only unbind ldap connection if bind succeeded
---
 src/src/lookups/ldap.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/src/src/lookups/ldap.c b/src/src/lookups/ldap.c
index bb29b43..6129b4b 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;
   }
 }