From f5de69b854e69fb2ab02899ee15db6299a996ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnter=20Obiltschnig?= Date: Tue, 15 Jun 2021 14:43:21 +0200 Subject: [PATCH] #3260: Memory leak in EVPPKey::loadKey used with files & wrong password --- Crypto/include/Poco/Crypto/EVPPKey.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Crypto/include/Poco/Crypto/EVPPKey.h b/Crypto/include/Poco/Crypto/EVPPKey.h index 7e096ff49..87ab962d4 100644 --- a/Crypto/include/Poco/Crypto/EVPPKey.h +++ b/Crypto/include/Poco/Crypto/EVPPKey.h @@ -195,9 +195,10 @@ private: poco_assert_dbg (typeid(K*) == typeid(EVP_PKEY*)); *ppKey = (K*)pKey; } - if(!*ppKey) goto error; + if (!*ppKey) goto error; return true; } + if (getFunc) EVP_PKEY_free(pKey); goto error; } else