]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC APL: Unlock mutex before freeing (clang tsan error)
authorHugo Landau <hlandau@openssl.org>
Mon, 22 May 2023 12:24:02 +0000 (13:24 +0100)
committerHugo Landau <hlandau@openssl.org>
Wed, 24 May 2023 09:34:55 +0000 (10:34 +0100)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20856)

ssl/quic/quic_impl.c

index ac0e9f0380618cafafedca698a71a62d07bfcfe8..cd54eda1c2111ed5e7ff818be01f728834f15239 100644 (file)
@@ -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
 }