Memory leak fix ktls_meth.c

The OSSL_RECORD_LAYER needs to be properly freed when return code isnt success.
Memory leak fix

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27111)

(cherry picked from commit e5e4cf41c7)
This commit is contained in:
jay9827342 2025-03-21 09:39:49 +00:00 committed by Tomas Mraz
parent d5d5ab9359
commit 00af1ac1fa
1 changed files with 1 additions and 1 deletions

View File

@ -432,7 +432,7 @@ ktls_new_record_layer(OSSL_LIB_CTX *libctx, const char *propq, int vers,
taglen, mactype, md, comp);
if (ret != OSSL_RECORD_RETURN_SUCCESS) {
OPENSSL_free(*retrl);
tls_free(*retrl);
*retrl = NULL;
} else {
/*