[USETUP] Free allocated memory after loading the new text-mode font from the .CAB file.

This commit is contained in:
Hermès Bélusca-Maïto 2020-12-12 01:33:56 +01:00
parent 4ab49bc276
commit e8c9a73bb8
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -733,8 +733,11 @@ SetConsoleOutputCP(
if (CabStatus != CAB_STATUS_SUCCESS)
{
DPRINT("CabinetLoadFile('%S', '%S') returned 0x%08x\n", FontFile, FontName, CabStatus);
if (ConsoleCabinetContext.Data)
RtlFreeHeap(ProcessHeap, 0, ConsoleCabinetContext.Data);
return FALSE;
}
ASSERT(ConsoleCabinetContext.Data);
Status = NtDeviceIoControlFile(hConsoleOutput,
NULL,
@ -746,6 +749,9 @@ SetConsoleOutputCP(
ConsoleCabinetContext.Size,
NULL,
0);
RtlFreeHeap(ProcessHeap, 0, ConsoleCabinetContext.Data);
if (!NT_SUCCESS(Status))
return FALSE;