From: Hugo Landau Date: Mon, 5 Feb 2024 13:34:01 +0000 (+0000) Subject: QUIC APL: Fix QUIC_TLS free order X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e76a3a645e1ad766950c7f79d2a3da560bb85a7;p=thirdparty%2Fopenssl.git QUIC APL: Fix QUIC_TLS free order Reviewed-by: Matt Caswell Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/23334) --- 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);