]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC APL: Fix QUIC_TLS free order
authorHugo Landau <hlandau@openssl.org>
Mon, 5 Feb 2024 13:34:01 +0000 (13:34 +0000)
committerNeil Horman <nhorman@openssl.org>
Mon, 17 Feb 2025 16:27:32 +0000 (11:27 -0500)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)

ssl/quic/quic_impl.c

index e3e56b0e3f802a4cc0ab7e7969d1636056e2993f..1cb44983b2f9e02c9a617961884c42f8e7cab78c 100644 (file)
@@ -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);