From: Ondřej Kuzník Date: Mon, 25 Apr 2022 15:53:25 +0000 (+0100) Subject: ITS#9831 Advance connections[index] correctly X-Git-Tag: OPENLDAP_REL_ENG_2_5_12~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fac3b0dc2f0dec14b6f6b5b405be4c5b328846b8;p=thirdparty%2Fopenldap.git ITS#9831 Advance connections[index] correctly --- diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 66bfd3c293..b8ea92a123 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -871,13 +871,14 @@ Connection* connection_next( Connection *c, ber_socket_t *index ) for(; *index < dtblsize; (*index)++) { if( connections[*index].c_sb ) { - c = &connections[(*index)++]; + c = &connections[*index]; ldap_pvt_thread_mutex_lock( &c->c_mutex ); if ( c->c_conn_state == SLAP_C_INVALID ) { ldap_pvt_thread_mutex_unlock( &c->c_mutex ); c = NULL; continue; } + (*index)++; break; } }