]> git.sur5r.net Git - openldap/commitdiff
ld_abandoned must be protected by ld_res_mutex
authorPierangelo Masarati <ando@openldap.org>
Sat, 1 Apr 2006 00:30:07 +0000 (00:30 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 1 Apr 2006 00:30:07 +0000 (00:30 +0000)
libraries/libldap/unbind.c

index 37616ed706287dcbb8b3a1b7ba1c7515e65ff0c1..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;