EVP: fix memleak in evp_pkey_downgrade()
authorRichard Levitte <levitte@openssl.org>
Sat, 11 Apr 2020 11:16:22 +0000 (13:16 +0200)
committerRichard Levitte <levitte@openssl.org>
Wed, 15 Apr 2020 09:04:35 +0000 (11:04 +0200)
commit49276c3569656a17c24517ff0781967ced2c9658
tree7fb911a6c8a6ef0f42e4bf10653fcf0da4b1109d
parent813d31717853252e777b810cb74fa5793fcbb154
EVP: fix memleak in evp_pkey_downgrade()

The EVP_KEYMGMT pointer in the pkey is removed when downgrading, but
wasn't necessarily freed when need, thus leaving an incorrect
reference count.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/11328)
crypto/evp/p_lib.c