From: Neil Horman Date: Mon, 17 Feb 2025 15:13:32 +0000 (-0500) Subject: Free hashtable prior to freeing atomic worker_lock X-Git-Tag: openssl-3.4.2~185 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1895255b9ac7ec8fd559a59b96a9878c825bc61;p=thirdparty%2Fopenssl.git 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) (cherry picked from commit 1636ae1a9022bad2fd5cf20f45e2729a55e688b7) --- 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; }