Module: wine Branch: master Commit: 4fd76b09958397477cea1c5c279f53bcd129752f URL: http://source.winehq.org/git/wine.git/?a=commit;h=4fd76b09958397477cea1c5c27...
Author: Vincent Povirk vincent@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; }