Free a fetched digest during EVP_MD_CTX_reset() not EVP_MD_free()
authorMatt Caswell <matt@openssl.org>
Thu, 26 Sep 2019 13:55:00 +0000 (14:55 +0100)
committerMatt Caswell <matt@openssl.org>
Thu, 3 Oct 2019 08:47:34 +0000 (09:47 +0100)
commit14bec2c4b4a74f7de3bdf4b3fff764d8842c27ab
tree12b850f4f0ceaa39d456eab22399a491254c6ce7
parent15de965ff04ccecb068f3ce6c643555dce9372c6
Free a fetched digest during EVP_MD_CTX_reset() not EVP_MD_free()

Otherwise a mem leak can occur since EVP_MD_free() calls
EVP_MD_CTX_reset() which then clears the contents of the ctx.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10013)
crypto/evp/digest.c