Commit 9ae5ef66 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

crypt32: Set lower quality chain count and pointer to 0 when freeing them.

parent 5d6feab0
......@@ -1062,6 +1062,8 @@ static void CRYPT_FreeLowerQualityChains(PCertificateChain chain)
for (i = 0; i < chain->context.cLowerQualityChainContext; i++)
CertFreeCertificateChain(chain->context.rgpLowerQualityChainContext[i]);
CryptMemFree(chain->context.rgpLowerQualityChainContext);
chain->context.cLowerQualityChainContext = 0;
chain->context.rgpLowerQualityChainContext = NULL;
}
static void CRYPT_FreeChainContext(PCertificateChain chain)
......@@ -1365,11 +1367,7 @@ BOOL WINAPI CertGetCertificateChain(HCERTCHAINENGINE hChainEngine,
} while (ret && alternate);
chain = CRYPT_ChooseHighestQualityChain(chain);
if (!(dwFlags & CERT_CHAIN_RETURN_LOWER_QUALITY_CONTEXTS))
{
CRYPT_FreeLowerQualityChains(chain);
chain->context.cLowerQualityChainContext = 0;
chain->context.rgpLowerQualityChainContext = NULL;
}
if (ppChainContext)
*ppChainContext = (PCCERT_CHAIN_CONTEXT)chain;
else
......
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