]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9498 connection_next: fix validity check
authorHoward Chu <hyc@openldap.org>
Thu, 11 Mar 2021 09:31:41 +0000 (09:31 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 11 Mar 2021 09:31:41 +0000 (09:31 +0000)
servers/slapd/connection.c

index 3c9c0caf42b6df5acfc11538b2372a64095ccd72..53c801c813bc4e5e802a784399952bdf7afea023 100644 (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;