From c605d9f054cbf05a7b37ddd26be9c821a4fd1e32 Mon Sep 17 00:00:00 2001 From: Thomas Faber Date: Sun, 10 Nov 2013 22:31:01 +0000 Subject: [PATCH] [WIN32K] - Do not leak process references (In|De)crementGdiHandleCount. CORE-7565 #resolve svn path=/trunk/; revision=60924 --- reactos/win32ss/gdi/ntgdi/gdiobj.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reactos/win32ss/gdi/ntgdi/gdiobj.c b/reactos/win32ss/gdi/ntgdi/gdiobj.c index 740fd92363c..34f33668592 100644 --- a/reactos/win32ss/gdi/ntgdi/gdiobj.c +++ b/reactos/win32ss/gdi/ntgdi/gdiobj.c @@ -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