ITS#9498 connection_next: fix validity check

This commit is contained in:
Howard Chu 2021-03-11 09:31:41 +00:00
parent c7763538de
commit 616e5bf1c3

View file

@ -919,11 +919,11 @@ Connection* connection_next( Connection *c, ber_socket_t *index )
ldap_pvt_thread_mutex_unlock( &connections_mutex );
ldap_pvt_thread_mutex_lock( &c->c_mutex );
ldap_pvt_thread_mutex_lock( &connections_mutex );
if ( c->c_struct_state != SLAP_C_USED ) {
ldap_pvt_thread_mutex_unlock( &c->c_mutex );
c = NULL;
continue;
}
}
if ( c->c_struct_state != SLAP_C_USED ) {
ldap_pvt_thread_mutex_unlock( &c->c_mutex );
c = NULL;
continue;
}
assert( c->c_conn_state != SLAP_C_INVALID );
break;