mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 02:15:43 +00:00
[NTOS:MM]
- Avoid reference leaks in failure cases of MmCreateCacheSection CORE-6931 svn path=/trunk/; revision=74383
This commit is contained in:
parent
599c80f8f2
commit
ec2dddf4cb
1 changed files with 4 additions and 0 deletions
4
reactos/ntoskrnl/cache/section/data.c
vendored
4
reactos/ntoskrnl/cache/section/data.c
vendored
|
@ -340,6 +340,7 @@ MmCreateCacheSection(PROS_SECTION_OBJECT *SectionObject,
|
|||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT("Failed: %x\n", Status);
|
||||
ObDereferenceObject(FileObject);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@ -382,6 +383,7 @@ MmCreateCacheSection(PROS_SECTION_OBJECT *SectionObject,
|
|||
{
|
||||
DPRINT("Status %x\n", Status);
|
||||
ObDereferenceObject(Section);
|
||||
ObDereferenceObject(FileObject);
|
||||
return Status;
|
||||
}
|
||||
ASSERT(Status != STATUS_PENDING);
|
||||
|
@ -413,6 +415,7 @@ MmCreateCacheSection(PROS_SECTION_OBJECT *SectionObject,
|
|||
{
|
||||
DPRINT("Zero size file\n");
|
||||
ObDereferenceObject(Section);
|
||||
ObDereferenceObject(FileObject);
|
||||
return STATUS_FILE_INVALID;
|
||||
}
|
||||
|
||||
|
@ -423,6 +426,7 @@ MmCreateCacheSection(PROS_SECTION_OBJECT *SectionObject,
|
|||
{
|
||||
DPRINT("Failed: STATUS_NO_MEMORY\n");
|
||||
ObDereferenceObject(Section);
|
||||
ObDereferenceObject(FileObject);
|
||||
return STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue