crypt32: Fix memory leak in failure cases.

This commit is contained in:
Juan Lang 2011-09-22 05:23:21 -07:00 committed by Alexandre Julliard
parent 546bfa2c1c
commit be0d294485
3 changed files with 3 additions and 3 deletions

View File

@ -160,7 +160,7 @@ PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType,
data = CryptMemAlloc(cbCertEncoded);
if (!data)
{
CryptMemFree(cert);
CertFreeCertificateContext(cert);
cert = NULL;
goto end;
}

View File

@ -58,7 +58,7 @@ PCCRL_CONTEXT WINAPI CertCreateCRLContext(DWORD dwCertEncodingType,
data = CryptMemAlloc(cbCrlEncoded);
if (!data)
{
CryptMemFree(crl);
CertFreeCRLContext(crl);
crl = NULL;
goto end;
}

View File

@ -447,7 +447,7 @@ PCCTL_CONTEXT WINAPI CertCreateCTLContext(DWORD dwMsgAndCertEncodingType,
end:
if (!ret)
{
CryptMemFree(ctl);
CertFreeCTLContext(ctl);
ctl = NULL;
LocalFree(ctlInfo);
CryptMemFree(content);