]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/unbind.c
ITS#6262
[openldap] / libraries / libldap / unbind.c
index 3e0bbab8f6b8de26d7d558bb807f05ed8f7732c2..15e6ee4f1b23c62756e542f4f42ba4af7ac7b26d 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2007 The OpenLDAP Foundation.
+ * Copyright 1998-2010 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -112,6 +112,18 @@ ldap_ld_free(
        ldap_pvt_thread_mutex_unlock( &ld->ld_res_mutex );
 #endif
 
+       /* final close callbacks */
+       {
+               ldaplist *ll, *next;
+
+               for ( ll = ld->ld_options.ldo_conn_cbs; ll; ll = next ) {
+                       ldap_conncb *cb = ll->ll_data;
+                       next = ll->ll_next;
+                       cb->lc_del( ld, NULL, cb );
+                       LDAP_FREE( ll );
+               }
+       }
+
        if ( ld->ld_error != NULL ) {
                LDAP_FREE( ld->ld_error );
                ld->ld_error = NULL;