Module: wine Branch: master Commit: 4060716dc4ca5d0468afb46a5f35083b7fe9669c URL: http://source.winehq.org/git/wine.git/?a=commit;h=4060716dc4ca5d0468afb46a5f...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Thu May 24 13:48:30 2012 +0900
gdiplus: Return correct status code if GdipAlloc fails.
---
dlls/gdiplus/region.c | 52 ++++++++++++++++++++++++------------------------ 1 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index e77a79b..fdc5dc3 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -254,20 +254,20 @@ GpStatus WINGDIPAPI GdipCombineRegionPath(GpRegion *region, GpPath *path, Combin }
left = GdipAlloc(sizeof(region_element)); - if (!left) - goto out; - *left = region->node; - - stat = clone_element(&path_region->node, &right); - if (stat != Ok) - goto out; - - fuse_region(region, left, right, mode); - - GdipDeleteRegion(path_region); - return Ok; + if (left) + { + *left = region->node; + stat = clone_element(&path_region->node, &right); + if (stat == Ok) + { + fuse_region(region, left, right, mode); + GdipDeleteRegion(path_region); + return Ok; + } + } + else + stat = OutOfMemory;
-out: GdipFree(left); GdipDeleteRegion(path_region); return stat; @@ -301,20 +301,20 @@ GpStatus WINGDIPAPI GdipCombineRegionRect(GpRegion *region, }
left = GdipAlloc(sizeof(region_element)); - if (!left) - goto out; - memcpy(left, ®ion->node, sizeof(region_element)); - - stat = clone_element(&rect_region->node, &right); - if (stat != Ok) - goto out; - - fuse_region(region, left, right, mode); - - GdipDeleteRegion(rect_region); - return Ok; + if (left) + { + memcpy(left, ®ion->node, sizeof(region_element)); + stat = clone_element(&rect_region->node, &right); + if (stat == Ok) + { + fuse_region(region, left, right, mode); + GdipDeleteRegion(rect_region); + return Ok; + } + } + else + stat = OutOfMemory;
-out: GdipFree(left); GdipDeleteRegion(rect_region); return stat;