Fix a leak in EVP_DigestInit_ex()
authorMatt Caswell <matt@openssl.org>
Fri, 10 Dec 2021 17:17:27 +0000 (17:17 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 10 Jan 2022 16:38:35 +0000 (16:38 +0000)
commit357bccc8ba64ec8a5f587b04b5d6b6ca9e8dcbdc
tree1084f1b3497e0aee5b21aebead310d480a12cc7c
parentd9ad5b16b32172df6f7d02cfb1c339cc85d0db01
Fix a leak in EVP_DigestInit_ex()

If an EVP_MD_CTX is reused then memory allocated and stored in md_data
can be leaked unless the EVP_MD's cleanup function is called.

Fixes #17149

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/17255)
crypto/evp/digest.c