[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.
This commit is contained in:
Tuur Martens 2022-06-03 17:46:28 +02:00 committed by George Bișoc
parent b60408c9f1
commit d31642c712

View file

@ -4787,6 +4787,7 @@ NtAllocateVirtualMemory(IN HANDLE ProcessHandle,
if (!NT_SUCCESS(Status))
{
DPRINT1("Failed to insert the VAD!\n");
ExFreePoolWithTag(Vad, 'SdaV');
goto FailPathNoLock;
}