- 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:
Hartmut Birr 2005-05-02 19:12:31 +00:00
parent 82eacd2e6d
commit 98c1f41b90

View file

@ -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,