https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d31642c712a2b35ff0247…
commit d31642c712a2b35ff024707a32c2783f15d16215
Author: Tuur Martens <tuurmartens4(a)gmail.com>
AuthorDate: Fri Jun 3 17:46:28 2022 +0200
Commit: George Bișoc <george.bisoc(a)reactos.org>
CommitDate: Sat Jun 4 22:44:27 2022 +0200
[NTOS:MM] Fix memory leak in NtAllocateVirtualMemory
When an allocated VAD's insertion fails, the VAD is not freed. This commit
attempts to fix this behaviour.
---
ntoskrnl/mm/ARM3/virtual.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ntoskrnl/mm/ARM3/virtual.c b/ntoskrnl/mm/ARM3/virtual.c
index c5c5a5283b0..4f5cd1b016b 100644
--- a/ntoskrnl/mm/ARM3/virtual.c
+++ b/ntoskrnl/mm/ARM3/virtual.c
@@ -4787,6 +4787,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to insert the VAD!\n");
+ ExFreePoolWithTag(Vad, 'SdaV');
goto FailPathNoLock;
}