https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e8c9a73bb8ec6f3a2102a…
commit e8c9a73bb8ec6f3a2102a171926fd503cd83a963
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sat Dec 12 01:33:56 2020 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Dec 27 00:51:56 2020 +0100
[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;