Author: tkreuzer
Date: Sat Nov 28 15:52:20 2015
New Revision: 70180
URL:
http://svn.reactos.org/svn/reactos?rev=70180&view=rev
Log:
[WIN32K]
Fix DC reference leak in IntPolygon.
Modified:
trunk/reactos/win32ss/gdi/ntgdi/fillshap.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/fillshap.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/fillshap…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/fillshap.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/fillshap.c [iso-8859-1] Sat Nov 28 15:52:20 2015
@@ -165,13 +165,20 @@
BOOL FASTCALL
IntPolygon(HDC hdc, POINT *Point, int Count)
{
- PDC dc;
- if (!(dc = DC_LockDc(hdc)))
- {
- EngSetLastError(ERROR_INVALID_HANDLE);
- return FALSE;
- }
- return IntGdiPolygon(dc, Point, Count);
+ BOOL bResult;
+ PDC pdc;
+
+ pdc = DC_LockDc(hdc);
+ if (pdc == NULL)
+ {
+ EngSetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+
+ bResult = IntGdiPolygon(pdc, Point, Count);
+
+ DC_UnlockDc(pdc);
+ return bResult;
}