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:
committed by
Stephan Aßmus
parent
66c7a2ac9c
commit
5723e0b250
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user