evp_pmeth: free the MD reference correctly.
authorPauli <paul.dale@oracle.com>
Wed, 29 Jan 2020 23:35:37 +0000 (09:35 +1000)
committerPauli <paul.dale@oracle.com>
Fri, 31 Jan 2020 07:52:05 +0000 (17:52 +1000)
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 <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10973)

crypto/evp/pmeth_lib.c

index dda9358c4e2969b70deb71155498aaa46b4a512d..075e87fe1c205a6c35594a84d7f9d0e990d45f07 100644 (file)
@@ -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;
     }