From 4fd76b09958397477cea1c5c279f53bcd129752f Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Sat, 5 Feb 2011 14:22:11 -0600 Subject: [PATCH] gdiplus: Fix error path in GdipAddPathRectangle. --- dlls/gdiplus/graphicspath.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index c9d67b19dcd..5a681470a56 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; }