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)
err:
if (ret != OSSL_RECORD_RETURN_SUCCESS) {
- OPENSSL_free(*retrl);
+ tls_int_free(*retrl);
*retrl = NULL;
}
return ret;