[WIN32K]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 28 Nov 2015 15:52:20 +0000 (15:52 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 28 Nov 2015 15:52:20 +0000 (15:52 +0000)
Fix DC reference leak in IntPolygon.

svn path=/trunk/; revision=70180

reactos/win32ss/gdi/ntgdi/fillshap.c

index fa9c27a..d6fbf24 100644 (file)
@@ -165,13 +165,20 @@ IntGdiPolyPolygon(DC      *dc,
 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;
 }