From e8c9a73bb8ec6f3a2102a171926fd503cd83a963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sat, 12 Dec 2020 01:33:56 +0100 Subject: [PATCH] [USETUP] Free allocated memory after loading the new text-mode font from the .CAB file. --- base/setup/usetup/console.c | 6 ++++++ 1 file changed, 6 insertions(+) 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;