Commit 4060716d authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

gdiplus: Return correct status code if GdipAlloc fails.

parent a7d14b0d
......@@ -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, &region->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, &region->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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment