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