]> 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)
committerViktor Dukhovni <openssl-users@dukhovni.org>
Wed, 11 Sep 2024 08:00:08 +0000 (18:00 +1000)
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 0a28bd9b5a3e2261414bbed55df82ea47bb2ccbe..e91d7e4192e796302d9f7f356a07290b0a2669b3 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);