Author: tkreuzer
Date: Fri Apr 13 18:33:56 2012
New Revision: 56342

URL: http://svn.reactos.org/svn/reactos?rev=56342&view=rev
Log:
[WIN32K]
Fix path reference leaks in PATH_add_outline
Should fix failed assertion when closing google earth.
thanks to r3ddr4g0n for providing the neccessary debug info.

Modified:
    trunk/reactos/win32ss/gdi/ntgdi/path.c

Modified: trunk/reactos/win32ss/gdi/ntgdi/path.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/path.c?rev=56342&r1=56341&r2=56342&view=diff
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/path.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/path.c [iso-8859-1] Fri Apr 13 18:33:56 2012
@@ -2005,10 +2005,12 @@
   PPATH pPath;
   TTPOLYGONHEADER *start;
   POINT pt;
+  BOOL bResult = FALSE;
 
   start = header;
 
   pPath = PATH_LockPath(dc->dclevel.hPath);
+  if (!pPath)
   {
      return FALSE;
   }
@@ -2020,7 +2022,7 @@
      if (header->dwType != TT_POLYGON_TYPE)
      {
         DPRINT1("Unknown header type %d\n", header->dwType);
-        return FALSE;
+        goto cleanup;
      }
 
      pt.x = x + int_from_fixed(header->pfxStart.x);
@@ -2055,7 +2057,7 @@
               POINTFX ptfx;
               POINT *pts = ExAllocatePoolWithTag(PagedPool, (curve->cpfx + 1) 
* sizeof(POINT), TAG_PATH);
 
-              if (!pts) return FALSE;
+              if (!pts) goto cleanup;
 
               ptfx = *(POINTFX *)((char *)curve - sizeof(POINTFX));
 
@@ -2076,7 +2078,7 @@
 
            default:
               DPRINT1("Unknown curve type %04x\n", curve->wType);
-              return FALSE;
+              goto cleanup;
         }
 
         curve = (TTPOLYCURVE *)&curve->apfx[curve->cpfx];
@@ -2084,9 +2086,12 @@
      header = (TTPOLYGONHEADER *)((char *)header + header->cb);
   }
 
+  bResult = TRUE;
+
+cleanup:
   IntGdiCloseFigure( pPath );
   PATH_UnlockPath( pPath );
-  return TRUE;
+  return bResult;
 }
 
 /**********************************************************************


Reply via email to