From 1636ae1a9022bad2fd5cf20f45e2729a55e688b7 Mon Sep 17 00:00:00 2001 From: Neil Horman Date: Mon, 17 Feb 2025 10:13:32 -0500 Subject: [PATCH] Free hashtable prior to freeing atomic worker_lock lhash_test uses a hashtable that may not be empty at the end of the test Given that the free function frees the elements in the list and uses the atomic worker_lock to do so, we need to free the hash table prior to freeing the working lock to avoid the use of unallocated memory. Fixes #26798 Reviewed-by: Bernd Edlinger Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/26800) --- test/lhash_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lhash_test.c b/test/lhash_test.c index aa5504c248a..193254b6a69 100644 --- a/test/lhash_test.c +++ b/test/lhash_test.c @@ -710,9 +710,9 @@ shutdown: end_free: shutting_down = 1; + ossl_ht_free(m_ht); CRYPTO_THREAD_lock_free(worker_lock); CRYPTO_THREAD_lock_free(testrand_lock); - ossl_ht_free(m_ht); end: return ret; } -- 2.47.2