- NtUserSetWindowsHookEx: Don't leak a thread reference in case we are passed a Thread Id
authorStefan Ginsberg <stefanginsberg@gmail.com>
Tue, 13 Jan 2009 23:41:34 +0000 (23:41 +0000)
committerStefan Ginsberg <stefanginsberg@gmail.com>
Tue, 13 Jan 2009 23:41:34 +0000 (23:41 +0000)
svn path=/trunk/; revision=38750

reactos/subsystems/win32/win32k/ntuser/hook.c

index efe6046..d0ff498 100644 (file)
@@ -1156,6 +1156,11 @@ NtUserSetWindowsHookEx(
    ClientInfo->phkCurrent = 0;
    
    UserDereferenceObject(Hook);
    ClientInfo->phkCurrent = 0;
    
    UserDereferenceObject(Hook);
+
+   if (NULL != Thread)
+   {
+      ObDereferenceObject(Thread);
+   }
    ObDereferenceObject(WinStaObj);
 
    RETURN( Handle);
    ObDereferenceObject(WinStaObj);
 
    RETURN( Handle);