From: Pierangelo Masarati Date: Thu, 30 Jun 2005 16:49:00 +0000 (+0000) Subject: tentative fix of another issue related to ITS#3800; please review X-Git-Tag: OPENLDAP_AC_BP~482 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=86e6207b63ec86ece6891c21e553e8a77383115f;p=openldap tentative fix of another issue related to ITS#3800; please review --- diff --git a/libraries/libldap/abandon.c b/libraries/libldap/abandon.c index fa7c74efc2..1b2964961e 100644 --- a/libraries/libldap/abandon.c +++ b/libraries/libldap/abandon.c @@ -262,6 +262,12 @@ do_abandon( } } +#ifdef LDAP_R_COMPILE + /* ld_abandoned is actually protected by the ld_res_mutex; + * give up the ld_req_mutex and get the other */ + ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex ); + ldap_pvt_thread_mutex_lock( &ld->ld_res_mutex ); +#endif i = 0; if ( ld->ld_abandoned != NULL ) { for ( ; ld->ld_abandoned[i] != -1; i++ ) @@ -276,7 +282,7 @@ do_abandon( if ( ld->ld_abandoned == NULL ) { ld->ld_abandoned = old_abandon; ld->ld_errno = LDAP_NO_MEMORY; - return( ld->ld_errno ); + goto done; } ld->ld_abandoned[i] = msgid; @@ -286,5 +292,10 @@ do_abandon( ld->ld_errno = LDAP_SUCCESS; } +done:; +#ifdef LDAP_R_COMPILE + ldap_pvt_thread_mutex_unlock( &ld->ld_res_mutex ); + ldap_pvt_thread_mutex_lock( &ld->ld_req_mutex ); +#endif return( ld->ld_errno ); }