Commit be0d2944 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Fix memory leak in failure cases.

parent 546bfa2c
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment