]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9831 Advance connections[index] correctly
authorOndřej Kuzník <ondra@mistotebe.net>
Mon, 25 Apr 2022 15:53:25 +0000 (16:53 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Wed, 27 Apr 2022 15:51:56 +0000 (15:51 +0000)
servers/slapd/connection.c

index 66bfd3c29309e7dec3f35c2a2d2a9fb6f88721af..b8ea92a123bdf00a84ddffa69a2079c420f4ed95 100644 (file)
@@ -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;
                }
        }