X509_PUBKEY_set(): Fix memory leak
authorRichard Levitte <levitte@openssl.org>
Fri, 7 Feb 2020 08:13:21 +0000 (09:13 +0100)
committerRichard Levitte <levitte@openssl.org>
Tue, 11 Feb 2020 12:10:24 +0000 (13:10 +0100)
commita076951b71a1837e68eaf6bfd92e6a4d40b0940a
treea03dffe2c37e7dc61764594f48c3d9b822b02086
parent29f178bddfdbd11218fbcba0b8060297696968e3
X509_PUBKEY_set(): Fix memory leak

With the provided method of creating the new X509_PUBKEY, an extra
EVP_PKEY is created and needs to be properly cleaned away.

(note: we could choose to keep it just as well, but there are
consequences, explained in a comment in the code)

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