mirror of
https://github.com/reactos/reactos.git
synced 2024-10-01 23:14:53 +00:00
[NTOSKNRL]
Misc fixes in NtQueryDirectoryFile(): - Don't leak auxbuffer - Don't allow two completion routines svn path=/trunk/; revision=74451
This commit is contained in:
parent
e6825b17d8
commit
335b3f2e4e
|
@ -1901,6 +1901,14 @@ NtQueryDirectoryFile(IN HANDLE FileHandle,
|
|||
return Status;
|
||||
}
|
||||
|
||||
/* Are there two associated completion routines? */
|
||||
if (FileObject->CompletionContext != NULL && ApcRoutine != NULL)
|
||||
{
|
||||
ObDereferenceObject(FileObject);
|
||||
if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
/* Check if we have an even handle */
|
||||
if (EventHandle)
|
||||
{
|
||||
|
@ -1914,6 +1922,7 @@ NtQueryDirectoryFile(IN HANDLE FileHandle,
|
|||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
/* Fail */
|
||||
if (AuxBuffer) ExFreePoolWithTag(AuxBuffer, TAG_SYSB);
|
||||
ObDereferenceObject(FileObject);
|
||||
return Status;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue