diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-08-18 17:16:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-08-18 21:08:40 +0100 |
commit | cafe446d2456e5bed120045b1c693fbe31874262 (patch) | |
tree | f2e7deaa15c70fe597d8dde9c87b0b3de98bac39 /xmloff | |
parent | bbc2824876f102f237fbe40c16321c31fbdf4779 (diff) |
coverity#1371377 Resource leak
Change-Id: Ib8fddfe5c62b937d23306a31a2a8ab9c83179546
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/style/MarkerStyle.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/xmloff/source/style/MarkerStyle.cxx b/xmloff/source/style/MarkerStyle.cxx index e109c78581dc..a0dc8db6c587 100644 --- a/xmloff/source/style/MarkerStyle.cxx +++ b/xmloff/source/style/MarkerStyle.cxx @@ -57,7 +57,7 @@ void XMLMarkerStyleImport::importXML( bool bHasPathData = false; OUString aDisplayName; - SdXMLImExViewBox* pViewBox = nullptr; + std::unique_ptr<SdXMLImExViewBox> xViewBox; SvXMLNamespaceMap& rNamespaceMap = rImport.GetNamespaceMap(); SvXMLUnitConverter& rUnitConverter = rImport.GetMM100UnitConverter(); @@ -82,7 +82,7 @@ void XMLMarkerStyleImport::importXML( } else if( IsXMLToken( aStrAttrName, XML_VIEWBOX ) ) { - pViewBox = new SdXMLImExViewBox( aStrValue, rUnitConverter ); + xViewBox.reset(new SdXMLImExViewBox(aStrValue, rUnitConverter)); bHasViewBox = true; } @@ -104,11 +104,12 @@ void XMLMarkerStyleImport::importXML( // ViewBox probably not used, but stay with former processing inside of // SdXMLImExSvgDElement const basegfx::B2DRange aSourceRange( - pViewBox->GetX(), pViewBox->GetY(), - pViewBox->GetX() + pViewBox->GetWidth(), pViewBox->GetY() + pViewBox->GetHeight()); + xViewBox->GetX(), xViewBox->GetY(), + xViewBox->GetX() + xViewBox->GetWidth(), + xViewBox->GetY() + xViewBox->GetHeight()); const basegfx::B2DRange aTargetRange( 0.0, 0.0, - pViewBox->GetWidth(), pViewBox->GetHeight()); + xViewBox->GetWidth(), xViewBox->GetHeight()); if(!aSourceRange.equal(aTargetRange)) { @@ -136,7 +137,7 @@ void XMLMarkerStyleImport::importXML( } } - delete pViewBox; + xViewBox.reset(); } // Export |