From 45b7c7e06e8d28ad9a7ea0f7662ec04f283f7c36 Mon Sep 17 00:00:00 2001 From: Hugo Landau Date: Mon, 22 May 2023 13:24:02 +0100 Subject: QUIC APL: Unlock mutex before freeing (clang tsan error) Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/20856) --- ssl/quic/quic_impl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ssl/quic/quic_impl.c') 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 } -- cgit v1.2.3