Author: tfaber
Date: Thu Apr 20 08:58:45 2017
New Revision: 74383
URL:
http://svn.reactos.org/svn/reactos?rev=74383&view=rev
Log:
[NTOS:MM]
- Avoid reference leaks in failure cases of MmCreateCacheSection
CORE-6931
Modified:
trunk/reactos/ntoskrnl/cache/section/data.c
Modified: trunk/reactos/ntoskrnl/cache/section/data.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cache/section/dat…
==============================================================================
--- trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/cache/section/data.c [iso-8859-1] Thu Apr 20 08:58:45 2017
@@ -340,6 +340,7 @@
if (!NT_SUCCESS(Status))
{
DPRINT("Failed: %x\n", Status);
+ ObDereferenceObject(FileObject);
return Status;
}
@@ -382,6 +383,7 @@
{
DPRINT("Status %x\n", Status);
ObDereferenceObject(Section);
+ ObDereferenceObject(FileObject);
return Status;
}
ASSERT(Status != STATUS_PENDING);
@@ -413,6 +415,7 @@
{
DPRINT("Zero size file\n");
ObDereferenceObject(Section);
+ ObDereferenceObject(FileObject);
return STATUS_FILE_INVALID;
}
@@ -423,6 +426,7 @@
{
DPRINT("Failed: STATUS_NO_MEMORY\n");
ObDereferenceObject(Section);
+ ObDereferenceObject(FileObject);
return STATUS_NO_MEMORY;
}