Fix a memory leak in tls_new_record_layer
authorMatt Caswell <matt@openssl.org>
Wed, 16 Aug 2023 11:15:07 +0000 (12:15 +0100)
committerTomas Mraz <tomas@openssl.org>
Thu, 17 Aug 2023 19:35:53 +0000 (21:35 +0200)
commit0577dbad0709f1b3717297420069c6160245e74d
treee8ed2dc97afa5f22f52b618646bd264db0e94106
parent4a469cba27cf778f1d97ddeefd3a3a80cd623553
Fix a memory leak in tls_new_record_layer

If setting the crypto state has failed then memory might have been
partially allocated to fields within the partially constructed record
layer. We need to call tls_int_free() to properly free it.

Found by the reproducible error patch in openssl#21668

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21753)
ssl/record/methods/tls_common.c