Author: tfaber
Date: Wed Mar 1 13:10:52 2017
New Revision: 74013
URL:
http://svn.reactos.org/svn/reactos?rev=74013&view=rev
Log:
[NTOS:IO]
- Avoid event leak in NtQueryInformationFile. CID 716584
Modified:
trunk/reactos/ntoskrnl/io/iomgr/iofunc.c
Modified: trunk/reactos/ntoskrnl/io/iomgr/iofunc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/iofunc.c…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/iofunc.c [iso-8859-1] Wed Mar 1 13:10:52 2017
@@ -2240,8 +2240,17 @@
}
_SEH2_END;
- /* Unlock FO */
- IopUnlockFileObject(FileObject);
+ /* Free the event if we had one */
+ if (LocalEvent)
+ {
+ ExFreePoolWithTag(Event, TAG_IO);
+ }
+
+ /* If FO was locked, unlock it */
+ if (FileObject->Flags & FO_SYNCHRONOUS_IO)
+ {
+ IopUnlockFileObject(FileObject);
+ }
/* We're done with FastIO! */
ObDereferenceObject(FileObject);