diff options
author | Hugo Landau <hlandau@openssl.org> | 2024-02-08 10:27:56 +0000 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2024-02-09 14:10:17 +0100 |
commit | 62cb7c810e882895a71ba2cc479f482df0aa8e32 (patch) | |
tree | 835ecd73332006d90857245d1e713f5a8739d6f9 /ssl | |
parent | d8d19107618dd89c4584996b2bbed32b983d3890 (diff) | |
download | openssl-62cb7c810e882895a71ba2cc479f482df0aa8e32.tar.gz |
THREADING: Make CRYPTO_MUTEX and CRYPTO_CONDVAR typesafe
There was really no need for this to be void and it made bugs very easy
to introduce accidentally, especially given that the free functions
needed to be passed a pointer to the pointer.
Also fix some bugs in the QUIC code detected immediately by this change.
.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23519)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/quic/quic_impl.c | 2 | ||||
-rw-r--r-- | ssl/quic/quic_thread_assist.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index de39a5c7aa..af505d1203 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -453,7 +453,7 @@ SSL *ossl_quic_new(SSL_CTX *ctx) err: if (ssl_base == NULL) { #if defined(OPENSSL_THREADS) - ossl_crypto_mutex_free(qc->mutex); + ossl_crypto_mutex_free(&qc->mutex); #endif OPENSSL_free(qc); } else { diff --git a/ssl/quic/quic_thread_assist.c b/ssl/quic/quic_thread_assist.c index e1de72a910..ad49781c74 100644 --- a/ssl/quic/quic_thread_assist.c +++ b/ssl/quic/quic_thread_assist.c @@ -91,7 +91,7 @@ int ossl_quic_thread_assist_init_start(QUIC_THREAD_ASSIST *qta, qta->t = ossl_crypto_thread_native_start(assist_thread_main, qta, /*joinable=*/1); if (qta->t == NULL) { - ossl_crypto_condvar_free(qta->cv); + ossl_crypto_condvar_free(&qta->cv); return 0; } |