RegionSupport: Fix memory leak

In XXorRegion(), memory allocated in if statement might be leaked.
Pointed by Clang Static Analyzer.

Change-Id: I6b8b68bc5fea7b7c1fd354f05f03d3ebb0b11b62
Reviewed-on: https://review.haiku-os.org/633
Reviewed-by: Stephan Aßmus <[email protected]>
This commit is contained in:
Murai Takashi
2018-10-17 11:42:58 +00:00
committed by Stephan Aßmus
parent 66c7a2ac9c
commit 5723e0b250
+4
View File
@@ -1528,7 +1528,11 @@ BRegion::Support::XXorRegion(const BRegion* sra, const BRegion* srb,
BRegion* trb;
if ((! (tra = CreateRegion())) || (! (trb = CreateRegion())))
{
DestroyRegion(tra);
DestroyRegion(trb);
return 0;
}
(void) XSubtractRegion(sra,srb,tra);
(void) XSubtractRegion(srb,sra,trb);
(void) XUnionRegion(tra,trb,dr);