gdiplus: Return correct status code if GdipAlloc fails.

This commit is contained in:
Dmitry Timoshkov 2012-05-24 13:48:30 +09:00 committed by Alexandre Julliard
parent a7d14b0d2c
commit 4060716dc4
1 changed files with 26 additions and 26 deletions

View File

@ -254,20 +254,20 @@ GpStatus WINGDIPAPI GdipCombineRegionPath(GpRegion *region, GpPath *path, Combin
}
left = GdipAlloc(sizeof(region_element));
if (!left)
goto out;
if (left)
{
*left = region->node;
stat = clone_element(&path_region->node, &right);
if (stat != Ok)
goto out;
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;
if (left)
{
memcpy(left, &region->node, sizeof(region_element));
stat = clone_element(&rect_region->node, &right);
if (stat != Ok)
goto out;
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;