From: Pauli Date: Wed, 29 Jan 2020 23:35:37 +0000 (+1000) Subject: evp_pmeth: free the MD reference correctly. X-Git-Tag: openssl-3.0.0-alpha1~580 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c98eab85b8a6c5d49353a229ac1d2f4cd0b84682;p=oweals%2Fopenssl.git evp_pmeth: free the MD reference correctly. The code was calling EVP_MD_meth_free which is incorrect. It should call EVP_MD_free. It happened to work but by luck rather than design. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/10973) --- diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c index dda9358c4e..075e87fe1c 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -834,7 +834,7 @@ static int legacy_ctrl_str_to_param(EVP_PKEY_CTX *ctx, const char *name, if (md == NULL) return 0; ret = EVP_PKEY_CTX_set_signature_md(ctx, md); - EVP_MD_meth_free(md); + EVP_MD_free(md); return ret; }