summaryrefslogtreecommitdiffstats
path: root/ssl/quic/quic_impl.c
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-05-22 13:24:02 +0100
committerHugo Landau <hlandau@openssl.org>2023-05-24 10:34:55 +0100
commit45b7c7e06e8d28ad9a7ea0f7662ec04f283f7c36 (patch)
tree3770beea1c9b6fed844a562e6cde07047c6df873 /ssl/quic/quic_impl.c
parentabbbc06a94cafa7e212bfe7dcbf818ac33d986d3 (diff)
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)
Diffstat (limited to 'ssl/quic/quic_impl.c')
-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
}