summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-05-22 14:24:02 +0200
committerHugo Landau <hlandau@openssl.org>2023-05-24 11:34:55 +0200
commit45b7c7e06e8d28ad9a7ea0f7662ec04f283f7c36 (patch)
tree3770beea1c9b6fed844a562e6cde07047c6df873
parentRemove an unused variable (clang 16 warning) (diff)
downloadopenssl-45b7c7e06e8d28ad9a7ea0f7662ec04f283f7c36.tar.xz
openssl-45b7c7e06e8d28ad9a7ea0f7662ec04f283f7c36.zip
QUIC APL: Unlock mutex before freeing (clang tsan error)
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20856)
-rw-r--r--ssl/quic/quic_impl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c
index ac0e9f0380..cd54eda1c2 100644
--- a/ssl/quic/quic_impl.c
+++ b/ssl/quic/quic_impl.c
@@ -444,8 +444,9 @@ void ossl_quic_free(SSL *s)
/* Note: SSL_free calls OPENSSL_free(qc) for us */
SSL_free(ctx.qc->tls);
+ quic_unlock(ctx.qc); /* tsan doesn't like freeing locked mutexes */
#if defined(OPENSSL_THREADS)
- ossl_crypto_mutex_free(&ctx.qc->mutex); /* freed while still locked */
+ ossl_crypto_mutex_free(&ctx.qc->mutex);
#endif
}