From: Howard Chu Date: Thu, 11 Mar 2021 09:31:41 +0000 (+0000) Subject: ITS#9498 connection_next: fix validity check X-Git-Tag: OPENLDAP_REL_ENG_2_5_3BETA~6^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=616e5bf1c30b6c3f4c346e7a864f598bedec60e1;p=thirdparty%2Fopenldap.git ITS#9498 connection_next: fix validity check --- diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 3c9c0caf42..53c801c813 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -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;