]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/unbind.c
Misc library fixes from HEAD
[openldap] / libraries / libldap / unbind.c
index 24cf90ad249c6d9bbb9b47524f691c6efb3ff658..564432ea78f466efbce0628d3227b67ecdeb4379 100644 (file)
@@ -106,6 +106,11 @@ ldap_ld_free(
                next = lm->lm_next;
                ldap_msgfree( lm );
        }
+
+       if ( ld->ld_abandoned != NULL ) {
+               LDAP_FREE( ld->ld_abandoned );
+               ld->ld_abandoned = NULL;
+       }
 #ifdef LDAP_R_COMPILE
        ldap_pvt_thread_mutex_unlock( &ld->ld_res_mutex );
 #endif
@@ -125,11 +130,6 @@ ldap_ld_free(
                ld->ld_referrals = NULL;
        }  
     
-       if ( ld->ld_abandoned != NULL ) {
-               LDAP_FREE( ld->ld_abandoned );
-               ld->ld_abandoned = NULL;
-       }
-
        if ( ld->ld_selectinfo != NULL ) {
                ldap_free_select_info( ld->ld_selectinfo );
                ld->ld_selectinfo = NULL;
@@ -194,6 +194,7 @@ ldap_ld_free(
 #ifdef LDAP_R_COMPILE
        ldap_pvt_thread_mutex_destroy( &ld->ld_req_mutex );
        ldap_pvt_thread_mutex_destroy( &ld->ld_res_mutex );
+       ldap_pvt_thread_mutex_destroy( &ld->ld_conn_mutex );
 #endif
 #ifndef NDEBUG
        LDAP_TRASH(ld);