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 <bernd.edlinger@hotmail.de>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26800)
(cherry picked from commit
1636ae1a9022bad2fd5cf20f45e2729a55e688b7)
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;
}