From 3e76a3a645e1ad766950c7f79d2a3da560bb85a7 Mon Sep 17 00:00:00 2001 From: Hugo Landau Date: Mon, 5 Feb 2024 13:34:01 +0000 Subject: [PATCH] QUIC APL: Fix QUIC_TLS free order Reviewed-by: Matt Caswell Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/23334) --- ssl/quic/quic_impl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index 0a28bd9b5a3..e91d7e4192e 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -524,6 +524,9 @@ err: QUIC_NEEDS_LOCK static void qc_cleanup(QUIC_CONNECTION *qc, int have_lock) { + SSL_free(qc->tls); + qc->tls = NULL; + ossl_quic_channel_free(qc->ch); qc->ch = NULL; @@ -543,9 +546,6 @@ static void qc_cleanup(QUIC_CONNECTION *qc, int have_lock) ossl_quic_engine_free(qc->engine); qc->engine = NULL; - SSL_free(qc->tls); - qc->tls = NULL; - if (have_lock) /* tsan doesn't like freeing locked mutexes */ ossl_crypto_mutex_unlock(qc->mutex); -- 2.47.2