EVP: Fix memory leak in EVP_PKEY_CTX_dup()
authorRichard Levitte <levitte@openssl.org>
Wed, 16 Dec 2020 16:01:06 +0000 (17:01 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 17 Dec 2020 11:02:08 +0000 (12:02 +0100)
commit74cd923a78b490d46af9c3dc5c8dc7a741c5e576
tree91eb3c50e9c31d66cef67281f0f9e67d5af906b4
parent390f9bad69ce19f601abf131ceabf90aedc0d3d5
EVP: Fix memory leak in EVP_PKEY_CTX_dup()

In most error cases, EVP_PKEY_CTX_dup() would only free the EVP_PKEY_CTX
without freeing the duplicated contents.

Fixes #13503

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13661)
crypto/evp/pmeth_lib.c