hrev52402 adds 1 changeset to branch 'master'
old head: 66c7a2ac9c1fcccc1455d2bc0a617bc44c631bfa
new head: 5723e0b2507bb9cf01956889ff6bf8563e6b02ae
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=5723e0b2507b+%5E66c7a2ac9c1f
----------------------------------------------------------------------------
5723e0b2507b: 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 <superstippi@xxxxxx>
[ Murai Takashi <tmurai01@xxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev52402
Commit: 5723e0b2507bb9cf01956889ff6bf8563e6b02ae
URL: https://git.haiku-os.org/haiku/commit/?id=5723e0b2507b
Author: Murai Takashi <tmurai01@xxxxxxxxx>
Date: Wed Oct 17 10:55:14 2018 UTC
Committer: Stephan Aßmus <superstippi@xxxxxx>
Commit-Date: Wed Oct 17 11:42:58 2018 UTC
----------------------------------------------------------------------------
1 file changed, 4 insertions(+)
src/kits/interface/RegionSupport.cpp | 4 ++++
----------------------------------------------------------------------------
diff --git a/src/kits/interface/RegionSupport.cpp
b/src/kits/interface/RegionSupport.cpp
index b8a8ed5bd8..780fbba829 100644
--- a/src/kits/interface/RegionSupport.cpp
+++ b/src/kits/interface/RegionSupport.cpp
@@ -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);