]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Move fr_assert() check of mutex-guarded data after the lock (CID #1587069)
authorJames Jones <jejones3141@gmail.com>
Thu, 25 Jan 2024 21:56:41 +0000 (15:56 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 25 Jan 2024 23:28:57 +0000 (17:28 -0600)
src/lib/io/master.c

index 52733d8f4ec7eb68b24c05620e865ba1ad77acfd..04bff39628713efda3abdbbd8a425f9b57c8e40a 100644 (file)
@@ -2062,13 +2062,13 @@ static void client_expiry_timer(fr_event_list_t *el, fr_time_t now, void *uctx)
        }
 
        fr_assert(!connection);
-       fr_assert(client->ht != NULL);
 
        /*
         *      Find out how many connections are using this
         *      client.
         */
        pthread_mutex_lock(&client->mutex);
+       fr_assert(client->ht != NULL);
        connections = fr_hash_table_num_elements(client->ht);
        pthread_mutex_unlock(&client->mutex);