summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-05-18 22:21:04 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-05-20 15:21:51 +0100
commit908f56761eb0b789137c50cfee1e8a84a1db51d2 (patch)
tree113e43438f8ec44f30dde5c82e618ec989c02aa7
parent82cb48a7f71b2591dbfa2079ec3ca859fbbe8c47 (diff)
valgrind: fix leak when range isn't transferred to rangelist
-rw-r--r--sc/source/core/tool/rangeutl.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/sc/source/core/tool/rangeutl.cxx b/sc/source/core/tool/rangeutl.cxx
index 3c5014304..e80031f26 100644
--- a/sc/source/core/tool/rangeutl.cxx
+++ b/sc/source/core/tool/rangeutl.cxx
@@ -557,12 +557,19 @@ sal_Bool ScRangeStringConverter::GetRangeListFromString(
while( nOffset >= 0 )
{
ScRange* pRange = new ScRange;
- if ( GetRangeFromString( *pRange, rRangeListStr, pDocument, eConv, nOffset, cSeperator, cQuote )
- && (nOffset >= 0)
+ if (
+ GetRangeFromString( *pRange, rRangeListStr, pDocument, eConv, nOffset, cSeperator, cQuote ) &&
+ (nOffset >= 0)
)
+ {
rRangeList.push_back( pRange );
+ pRange = NULL;
+ }
else if (nOffset > -1)
bRet = false;
+ //if ownership transferred to rRangeList pRange was NULLed, otherwwise
+ //delete it
+ delete pRange;
}
return bRet;
}