mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
Fixed bug in IO manager that caused crash when trying to open a file on a non existant device
Fixed memory leaks in object manager svn path=/trunk/; revision=964
This commit is contained in:
parent
3a18299c0f
commit
52404fd1c8
2 changed files with 10 additions and 2 deletions
|
@ -67,7 +67,11 @@ NTSTATUS IopCreateFile(PVOID ObjectBody,
|
|||
DPRINT("DeviceObject was NULL\n");
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
||||
if( BODY_TO_HEADER( Parent )->ObjectType != IoDeviceType )
|
||||
{
|
||||
DPRINT( "Parent is not a device type\n" );
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
Status = ObReferenceObjectByPointer(DeviceObject,
|
||||
STANDARD_RIGHTS_REQUIRED,
|
||||
IoDeviceType,
|
||||
|
|
|
@ -176,7 +176,10 @@ PVOID ObCreateObject(PHANDLE Handle,
|
|||
ObjectAttributes);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
return(NULL);
|
||||
ObDereferenceObject( Parent );
|
||||
RtlFreeUnicodeString( &Header->Name );
|
||||
ExFreePool( Header );
|
||||
return(NULL);
|
||||
}
|
||||
}
|
||||
return(HEADER_TO_BODY(Header));
|
||||
|
@ -260,6 +263,7 @@ NTSTATUS ObPerformRetentionChecks(POBJECT_HEADER Header)
|
|||
if (Header->Name.Buffer != NULL)
|
||||
{
|
||||
ObRemoveEntry(Header);
|
||||
RtlFreeUnicodeString( &Header->Name );
|
||||
}
|
||||
DPRINT("ObPerformRetentionChecks() = Freeing object\n");
|
||||
ExFreePool(Header);
|
||||
|
|
Loading…
Reference in a new issue