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)
This commit is contained in:
Matt Caswell 2023-10-27 12:22:11 +01:00
parent 497a7810bc
commit 8d13d9e730
1 changed files with 2 additions and 0 deletions

View 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);
}