]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Check for NULL when freeing the QUIC_TLS object
authorMatt Caswell <matt@openssl.org>
Fri, 27 Oct 2023 11:22:11 +0000 (12:22 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 31 Oct 2023 11:40:02 +0000 (11:40 +0000)
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)

ssl/quic/quic_tls.c

index af4af56c77b4adfb59c9445ed95199979c59cc38..25687db2fb628e3ea33af24b81e84c09ea48bc84 100644 (file)
@@ -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);
 }