Vincent Povirk : gdiplus: Fix error path in GdipAddPathRectangle.

Alexandre Julliard julliard at winehq.org
Mon Feb 7 16:06:38 CST 2011


Module: wine
Branch: master
Commit: 4fd76b09958397477cea1c5c279f53bcd129752f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4fd76b09958397477cea1c5c279f53bcd129752f

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Sat Feb  5 14:22:11 2011 -0600

gdiplus: Fix error path in GdipAddPathRectangle.

---

 dlls/gdiplus/graphicspath.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c
index c9d67b1..5a68147 100644
--- a/dlls/gdiplus/graphicspath.c
+++ b/dlls/gdiplus/graphicspath.c
@@ -1536,9 +1536,10 @@ GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y,
 
 fail:
     /* reverting */
-    GdipDeletePath(path);
-    GdipClonePath(backup, &path);
-    GdipDeletePath(backup);
+    GdipFree(path->pathdata.Points);
+    GdipFree(path->pathdata.Types);
+    memcpy(path, backup, sizeof(*path));
+    GdipFree(backup);
 
     return retstat;
 }
@@ -1581,9 +1582,10 @@ GpStatus WINGDIPAPI GdipAddPathRectangles(GpPath *path, GDIPCONST GpRectF *rects
 
 fail:
     /* reverting */
-    GdipDeletePath(path);
-    GdipClonePath(backup, &path);
-    GdipDeletePath(backup);
+    GdipFree(path->pathdata.Points);
+    GdipFree(path->pathdata.Types);
+    memcpy(path, backup, sizeof(*path));
+    GdipFree(backup);
 
     return retstat;
 }




More information about the wine-cvs mailing list