[NTOSKRNL]
authorPierre Schweitzer <pierre@reactos.org>
Sun, 27 Nov 2016 20:11:30 +0000 (20:11 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Sun, 27 Nov 2016 20:11:30 +0000 (20:11 +0000)
Don't leak FO reference on failure.
Fixes kmtest:NtCreateSection unloading.
Dedicated to Thomas.

CORE-11819
CORE-12475

svn path=/trunk/; revision=73399

reactos/ntoskrnl/mm/section.c

index 1bfcfb4..22d3b99 100644 (file)
@@ -5077,6 +5077,8 @@ MmCreateSection (OUT PVOID  * Section,
         if (!NT_SUCCESS(Status) && Status != STATUS_END_OF_FILE)
         {
             DPRINT1("CC failure: %lx\n", Status);
         if (!NT_SUCCESS(Status) && Status != STATUS_END_OF_FILE)
         {
             DPRINT1("CC failure: %lx\n", Status);
+            if (FileObject)
+                ObDereferenceObject(FileObject);
             return Status;
         }
         // Caching is initialized...
             return Status;
         }
         // Caching is initialized...