diff --git a/base/setup/usetup/console.c b/base/setup/usetup/console.c index 57b396aafde..ab3587eb52e 100644 --- a/base/setup/usetup/console.c +++ b/base/setup/usetup/console.c @@ -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;