From: Matt Caswell Date: Fri, 27 Oct 2023 11:22:11 +0000 (+0100) Subject: Check for NULL when freeing the QUIC_TLS object X-Git-Tag: openssl-3.3.0-alpha1~712 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8d13d9e7305643c28c69c57df798b553b78c2876;p=thirdparty%2Fopenssl.git Check for NULL when freeing the QUIC_TLS object Free functions are expected to be tolerant of a NULL pointer being passed. Fixes the problem in https://github.com/openssl/openssl/pull/21668#issuecomment-1782718328 Reviewed-by: Paul Dale Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/22536) --- diff --git a/ssl/quic/quic_tls.c b/ssl/quic/quic_tls.c index af4af56c77b..25687db2fb6 100644 --- a/ssl/quic/quic_tls.c +++ b/ssl/quic/quic_tls.c @@ -654,6 +654,8 @@ QUIC_TLS *ossl_quic_tls_new(const QUIC_TLS_ARGS *args) void ossl_quic_tls_free(QUIC_TLS *qtls) { + if (qtls == NULL) + return; OSSL_ERR_STATE_free(qtls->error_state); OPENSSL_free(qtls); }