gdiplus: Fix error path in GdipAddPathRectangle.

This commit is contained in:
Vincent Povirk 2011-02-05 14:22:11 -06:00 committed by Alexandre Julliard
parent cd3855f384
commit 4fd76b0995

View File

@ -1536,9 +1536,10 @@ GpStatus WINGDIPAPI GdipAddPathRectangle(GpPath *path, REAL x, REAL y,
fail: fail:
/* reverting */ /* reverting */
GdipDeletePath(path); GdipFree(path->pathdata.Points);
GdipClonePath(backup, &path); GdipFree(path->pathdata.Types);
GdipDeletePath(backup); memcpy(path, backup, sizeof(*path));
GdipFree(backup);
return retstat; return retstat;
} }
@ -1581,9 +1582,10 @@ GpStatus WINGDIPAPI GdipAddPathRectangles(GpPath *path, GDIPCONST GpRectF *rects
fail: fail:
/* reverting */ /* reverting */
GdipDeletePath(path); GdipFree(path->pathdata.Points);
GdipClonePath(backup, &path); GdipFree(path->pathdata.Types);
GdipDeletePath(backup); memcpy(path, backup, sizeof(*path));
GdipFree(backup);
return retstat; return retstat;
} }