mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
- Check first for a valid returned object in ObOpenObjectByName.
- Free always the remaining path string if an error is returned in ObOpenObjectByName. svn path=/trunk/; revision=14950
This commit is contained in:
parent
82eacd2e6d
commit
98c1f41b90
1 changed files with 10 additions and 4 deletions
|
@ -143,15 +143,21 @@ ObOpenObjectByName(IN POBJECT_ATTRIBUTES ObjectAttributes,
|
|||
return Status;
|
||||
}
|
||||
|
||||
if (Object == NULL)
|
||||
{
|
||||
RtlFreeUnicodeString(&RemainingPath);
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
if (RemainingPath.Buffer != NULL)
|
||||
{
|
||||
if (wcschr(RemainingPath.Buffer + 1, L'\\') == NULL)
|
||||
return STATUS_OBJECT_NAME_NOT_FOUND;
|
||||
Status = STATUS_OBJECT_NAME_NOT_FOUND;
|
||||
else
|
||||
return STATUS_OBJECT_PATH_NOT_FOUND;
|
||||
Status =STATUS_OBJECT_PATH_NOT_FOUND;
|
||||
RtlFreeUnicodeString(&RemainingPath);
|
||||
ObDereferenceObject(Object);
|
||||
return Status;
|
||||
}
|
||||
if (Object == NULL)
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
|
||||
Status = ObCreateHandle(PsGetCurrentProcess(),
|
||||
Object,
|
||||
|
|
Loading…
Reference in a new issue