]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldap/unbind.c
improved filter mapping/rewrite; improved result rewriting; improved attribute/object...
[openldap] / servers / slapd / back-ldap / unbind.c
index 93d2bd4f8b7149da54e90efabb71d6a8ddbedfec..523657ef240fd7af71e99e17823bb3ad4a1b4a91 100644 (file)
@@ -64,6 +64,7 @@ ldap_back_conn_destroy(
 #endif /* !NEW_LOGGING */
 
        lc_curr.conn = conn;
+       lc_curr.local_dn = conn->c_ndn;
        
        ldap_pvt_thread_mutex_lock( &li->conn_mutex );
        lc = avl_delete( &li->conntree, (caddr_t)&lc_curr, ldap_back_conn_cmp );
@@ -92,14 +93,7 @@ ldap_back_conn_destroy(
                 * and calling ldap_unbind on a corrupted header results
                 * in a segmentation fault
                 */
-               ldap_unbind(lc->ld);
-               if ( lc->bound_dn.bv_val ) {
-                       ch_free( lc->bound_dn.bv_val );
-               }
-               if ( lc->cred.bv_val ) {
-                       ch_free( lc->cred.bv_val );
-               }
-               ch_free( lc );
+               ldap_back_conn_free( lc );
        }
 
        /* no response to unbind */