Fix freeing logic in GetSupportedCP().
Patch by Victor Martinez Calvo.
CORE-13385

svn path=/trunk/; revision=74941
This commit is contained in:
Eric Kohl 2017-06-07 14:10:43 +00:00
parent 2c1c8e2f94
commit fd32dd8623

View file

@ -61,19 +61,20 @@ GetSupportedCP(
{
pCodePage->NextItem = PCPage;
PCPage = pCodePage;
wsprintf(szSection, L"CODEPAGE_REMOVE_%d", uiCodePage);
if ((uiCodePage == GetACP()) ||
(uiCodePage == GetOEMCP()) ||
(!SetupFindFirstLineW(hInf, szSection, L"AddReg", &Context2)))
{
pCodePage->Flags |= CODEPAGE_NOT_REMOVEABLE;
}
}
else
{
HeapFree(GetProcessHeap(), 0, pCodePage);
}
wsprintf(szSection, L"CODEPAGE_REMOVE_%d", uiCodePage);
if ((uiCodePage == GetACP()) ||
(uiCodePage == GetOEMCP()) ||
(!SetupFindFirstLineW(hInf, szSection, L"AddReg", &Context2)))
{
pCodePage->Flags |= CODEPAGE_NOT_REMOVEABLE;
}
}
if (!SetupFindNextLine(&Context, &Context))