mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-06-04 22:33:53 -04:00
Fix connection_get race condition on Windows
This commit is contained in:
parent
d3ceb19b91
commit
3b63f718e1
1 changed files with 9 additions and 0 deletions
|
|
@ -310,6 +310,15 @@ static Connection* connection_get( ber_socket_t s )
|
|||
assert( c->c_struct_state != SLAP_C_UNINITIALIZED );
|
||||
|
||||
ber_sockbuf_ctrl( c->c_sb, LBER_SB_OPT_GET_FD, &sd );
|
||||
#ifdef HAVE_WINSOCK
|
||||
/* Avoid race condition after releasing
|
||||
* connections_mutex
|
||||
*/
|
||||
if ( sd != s ) {
|
||||
ldap_pvt_thread_mutex_unlock( &c->c_mutex );
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
if( c->c_struct_state != SLAP_C_USED ) {
|
||||
/* connection must have been closed due to resched */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue