]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix duplicate mutex allocation in threads_win.c
authorNeil Horman <nhorman@openssl.org>
Wed, 10 Apr 2024 12:28:43 +0000 (08:28 -0400)
committerNeil Horman <nhorman@openssl.org>
Thu, 11 Apr 2024 16:22:33 +0000 (12:22 -0400)
Creating an rcu lock does a double allocation of the underlying mutex.
Not sure how asan didn't catch this, but we clearly have a duplicate
line here

Fixes #24085

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24086)

crypto/threads_win.c

index 84288699639975afb2b6d0fddb75a8c77aaee4ad..9aec5e972fcae88294a6cb60b3bfd06c72a90142 100644 (file)
@@ -158,7 +158,6 @@ CRYPTO_RCU_LOCK *ossl_rcu_lock_new(int num_writers)
     new->prior_signal = ossl_crypto_condvar_new();
     new->alloc_lock = ossl_crypto_mutex_new();
     new->prior_lock = ossl_crypto_mutex_new();
-    new->write_lock = ossl_crypto_mutex_new();
     new->qp_group = allocate_new_qp_group(new, num_writers + 1);
     if (new->qp_group == NULL
         || new->alloc_signal == NULL