]> git.ipfire.org Git - thirdparty/openssl.git/commit
test/evp_test.c: Free fetched_digest on error to avoid memory leak
authorJiashengJiang <jiasheng@purdue.edu>
Sat, 17 May 2025 00:20:47 +0000 (20:20 -0400)
committerTomas Mraz <tomas@openssl.org>
Thu, 29 May 2025 14:42:01 +0000 (16:42 +0200)
commit7515e01e6e1370c23fc3a781ec2f54140583d86b
treebd946378514df72c25d62b65d98e1d0b4192ac44
parente44317a383f7d36e195158da6aef5674c83eeec7
test/evp_test.c: Free fetched_digest on error to avoid memory leak

Call EVP_MD_free() to release fetched_digest if OPENSSL_zalloc() fails, preventing a memory leak.

Fixes: 2208ba56eb ("evp_test: Add the missing check after calling OPENSSL_malloc")
Signed-off-by: JiashengJiang <jiasheng@purdue.edu>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27648)

(cherry picked from commit e8deb32af4874c781838c1596c6355712b5d0ed0)
test/evp_test.c