From 616e5bf1c30b6c3f4c346e7a864f598bedec60e1 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 11 Mar 2021 09:31:41 +0000 Subject: [PATCH] ITS#9498 connection_next: fix validity check --- servers/slapd/connection.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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; -- 2.47.3