[WIN32K]
authorThomas Faber <thomas.faber@reactos.org>
Sun, 10 Nov 2013 22:31:01 +0000 (22:31 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 10 Nov 2013 22:31:01 +0000 (22:31 +0000)
- Do not leak process references (In|De)crementGdiHandleCount.
CORE-7565 #resolve

svn path=/trunk/; revision=60924

reactos/win32ss/gdi/ntgdi/gdiobj.c

index 740fd92..34f3366 100644 (file)
@@ -249,6 +249,7 @@ IncrementGdiHandleCount(ULONG ulProcessId)
 
     ppi = PsGetProcessWin32Process(pep);
     if (ppi) InterlockedIncrement((LONG*)&ppi->GDIHandleCount);
+    if (NT_SUCCESS(Status)) ObDereferenceObject(pep);
 }
 
 FORCEINLINE
@@ -264,6 +265,7 @@ DecrementGdiHandleCount(ULONG ulProcessId)
 
     ppi = PsGetProcessWin32Process(pep);
     if (ppi) InterlockedDecrement((LONG*)&ppi->GDIHandleCount);
+    if (NT_SUCCESS(Status)) ObDereferenceObject(pep);
 }
 
 static