(yet) another potential concurrency issue

This commit is contained in:
Pierangelo Masarati 2005-07-23 22:04:04 +00:00
parent 3e84f692aa
commit 7fade0d585
2 changed files with 12 additions and 4 deletions

View File

@ -612,8 +612,10 @@ void
ldap_free_request_int( LDAP *ld, LDAPRequest *lr )
{
if ( lr->lr_prev == NULL ) {
/* free'ing the first request? */
assert( ld->ld_requests == lr );
ld->ld_requests = lr->lr_next;
} else {
lr->lr_prev->lr_next = lr->lr_next;
}

View File

@ -712,7 +712,13 @@ lr->lr_res_matched ? lr->lr_res_matched : "" );
}
}
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock( &ld->ld_req_mutex );
#endif
ldap_free_request( ld, lr );
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex );
#endif
}
if ( lc != NULL ) {