Sync up to trunk HEAD (r64942).
authorDavid Quintana <gigaherz@gmail.com>
Thu, 23 Oct 2014 20:48:15 +0000 (20:48 +0000)
committerDavid Quintana <gigaherz@gmail.com>
Thu, 23 Oct 2014 20:48:15 +0000 (20:48 +0000)
svn path=/branches/shell-experiments/; revision=64943

win32ss/user/ntuser/hook.c

index 3e6e942..88d922a 100644 (file)
@@ -1402,7 +1402,7 @@ NtUserSetWindowsHookEx( HINSTANCE Mod,
                         BOOL Ansi)
 {
     PWINSTATION_OBJECT WinStaObj;
-    PHOOK Hook;
+    PHOOK Hook = NULL;
     UNICODE_STRING ModuleName;
     NTSTATUS Status;
     HHOOK Handle;
@@ -1634,6 +1634,8 @@ NtUserSetWindowsHookEx( HINSTANCE Mod,
     RETURN( Handle);
 
 CLEANUP:
+    if (Hook)
+        UserDereferenceObject(Hook);
     TRACE("Leave NtUserSetWindowsHookEx, ret=%p\n", _ret_);
     UserLeave();
     END_CLEANUP;