summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2023-10-27 12:22:11 +0100
committerMatt Caswell <matt@openssl.org>2023-10-31 11:40:47 +0000
commite99c771985cbaf6ae55912b581d115f5097fe2fd (patch)
tree4ff553b30e7785f42560c724fca075924e7d8170 /ssl
parentf205958d9f9a2ead9edc088b0d3f060ee7c5b8c4 (diff)
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 <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22536) (cherry picked from commit 8d13d9e7305643c28c69c57df798b553b78c2876)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/quic/quic_tls.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ssl/quic/quic_tls.c b/ssl/quic/quic_tls.c
index af4af56c77..25687db2fb 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);
}