diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-08-18 17:13:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-08-18 21:08:40 +0100 |
commit | bbc2824876f102f237fbe40c16321c31fbdf4779 (patch) | |
tree | bda252ea0d935996d955160965d0aa874c882ad7 | |
parent | 43641dbdfc25fdecee0c58acb98e016797399ea7 (diff) |
coverity#1371373 Resource leak
Change-Id: Ic292feea48f073b4f3c72d23d4516186ed06328e
-rw-r--r-- | sc/source/filter/xml/XMLTableShapeImportHelper.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx index 553c36fae9c2..75b83ff2ce4d 100644 --- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx +++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx @@ -97,7 +97,7 @@ void XMLTableShapeImportHelper::finishShape( sal_Int32 nEndY(-1); sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; table::CellAddress aEndCell; - OUString* pRangeList(nullptr); + std::unique_ptr<OUString> xRangeList; sal_Int16 nLayerID(-1); for( sal_Int16 i=0; i < nAttrCount; ++i ) { @@ -137,7 +137,7 @@ void XMLTableShapeImportHelper::finishShape( else if(nPrefix == XML_NAMESPACE_DRAW) { if (IsXMLToken(aLocalName, XML_NOTIFY_ON_UPDATE_OF_RANGES)) - pRangeList = new OUString(rValue); + xRangeList.reset(new OUString(rValue)); } } SetLayer(rShape, nLayerID, rShape->getShapeType()); @@ -153,17 +153,17 @@ void XMLTableShapeImportHelper::finishShape( } } - if (pRangeList) + if (xRangeList) { // #i78086# If there are notification ranges, the ChartListener must be created // also when anchored to the sheet // -> call AddOLE with invalid cell position (checked in ScMyShapeResizer::ResizeShapes) if (ScMyTables::IsOLE(rShape)) - rTables.AddOLE(rShape, *pRangeList); + rTables.AddOLE(rShape, *xRangeList); } - delete pRangeList; + xRangeList.reset(); } else // shape is annotation { |