Skip to content

Commit

Permalink
Check for NULL when freeing the QUIC_TLS object
Browse files Browse the repository at this point in the history
Free functions are expected to be tolerant of a NULL pointer being passed.

Fixes the problem in
openssl/openssl#21668 (comment)

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from openssl/openssl#22536)

Signed-off-by: fly2x <fly2x@hitls.org>
  • Loading branch information
mattcaswell authored and fly2x committed Nov 2, 2023
1 parent c015755 commit c223268
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ssl/quic/quic_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit c223268

Please sign in to comment.