crypt32: Fix memory leak in failure cases.
This commit is contained in:
parent
546bfa2c1c
commit
be0d294485
|
@ -160,7 +160,7 @@ PCCERT_CONTEXT WINAPI CertCreateCertificateContext(DWORD dwCertEncodingType,
|
|||
data = CryptMemAlloc(cbCertEncoded);
|
||||
if (!data)
|
||||
{
|
||||
CryptMemFree(cert);
|
||||
CertFreeCertificateContext(cert);
|
||||
cert = NULL;
|
||||
goto end;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ PCCRL_CONTEXT WINAPI CertCreateCRLContext(DWORD dwCertEncodingType,
|
|||
data = CryptMemAlloc(cbCrlEncoded);
|
||||
if (!data)
|
||||
{
|
||||
CryptMemFree(crl);
|
||||
CertFreeCRLContext(crl);
|
||||
crl = NULL;
|
||||
goto end;
|
||||
}
|
||||
|
|
|
@ -447,7 +447,7 @@ PCCTL_CONTEXT WINAPI CertCreateCTLContext(DWORD dwMsgAndCertEncodingType,
|
|||
end:
|
||||
if (!ret)
|
||||
{
|
||||
CryptMemFree(ctl);
|
||||
CertFreeCTLContext(ctl);
|
||||
ctl = NULL;
|
||||
LocalFree(ctlInfo);
|
||||
CryptMemFree(content);
|
||||
|
|
Loading…
Reference in New Issue