]> 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:07 +0000 (16:42 +0200)
commit9647fbad35c983e0833c6247c0c6da0259ec5bd6
treee550b86b474058ebbef83c3a1e37360389e49c67
parent54e738bdcb1c2ab0c153a38fd93ec8b512e899f7
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