This commit is contained in:
Günter Obiltschnig 2021-04-11 17:39:59 +02:00
parent 80237a8e55
commit f18ee10a3c

View File

@ -155,6 +155,7 @@ void PKCS12Container::load(PKCS12* pPKCS12, const std::string& password)
{ {
_pX509Cert.reset(new X509Certificate(pCert, true)); _pX509Cert.reset(new X509Certificate(pCert, true));
_pkcsFriendlyName = extractFriendlyName(pCert); _pkcsFriendlyName = extractFriendlyName(pCert);
X509_free(pCert);
} }
else _pX509Cert.reset(); else _pX509Cert.reset();
@ -171,17 +172,22 @@ void PKCS12Container::load(PKCS12* pPKCS12, const std::string& password)
_caCertList.push_back(X509Certificate(pX509, true)); _caCertList.push_back(X509Certificate(pX509, true));
_caCertNames.push_back(extractFriendlyName(pX509)); _caCertNames.push_back(extractFriendlyName(pX509));
} }
else throw OpenSSLException("PKCS12Container::load()"); else
{
sk_X509_pop_free(pCA, X509_free);
PKCS12_free(pPKCS12);
throw OpenSSLException("PKCS12Container::load()");
} }
} }
sk_X509_pop_free(pCA, X509_free);
}
} }
else else
{ {
PKCS12_free(pPKCS12);
throw OpenSSLException(); throw OpenSSLException();
} }
PKCS12_free(pPKCS12); PKCS12_free(pPKCS12);
sk_X509_pop_free(pCA, X509_free);
if (pCert) X509_free(pCert);
poco_assert_dbg (_caCertList.size() == _caCertNames.size()); poco_assert_dbg (_caCertList.size() == _caCertNames.size());
} }
else else