summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-11-29 20:49:03 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-11-29 20:49:35 +0000
commita426cf6034fa08108d5906991aaed47020be68d8 (patch)
tree9243a9fc442b28f6da8de01d47d2b77b73b63eef /package
parent64be56577ffd8325ae3a720d26dacf93af03a5da (diff)
ofz: Direct-leak
Change-Id: Id94586cc659a5e504c727c570dc9fc60c85c8820
Diffstat (limited to 'package')
-rw-r--r--package/source/xstor/xstorage.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx
index 9291eb53cbc7..56bc3d48e3bd 100644
--- a/package/source/xstor/xstorage.cxx
+++ b/package/source/xstor/xstorage.cxx
@@ -592,13 +592,13 @@ void OStorage_Impl::ReadContents()
uno::Reference< container::XNameContainer > xNameContainer( xNamed, uno::UNO_QUERY );
- SotElement_Impl* pNewElement = new SotElement_Impl( aName, xNameContainer.is(), false );
+ std::unique_ptr<SotElement_Impl> xNewElement(new SotElement_Impl(aName, xNameContainer.is(), false));
if ( m_nStorageType == embed::StorageFormats::OFOPXML && aName == "_rels" )
{
- if ( !pNewElement->m_bIsStorage )
+ if (!xNewElement->m_bIsStorage)
throw io::IOException( THROW_WHERE ); // TODO: Unexpected format
- m_pRelStorElement = pNewElement;
+ m_pRelStorElement = xNewElement.release();
CreateRelStorage();
}
else
@@ -606,10 +606,10 @@ void OStorage_Impl::ReadContents()
if ( ( m_nStorageMode & embed::ElementModes::TRUNCATE ) == embed::ElementModes::TRUNCATE )
{
// if a storage is truncated all of it elements are marked as deleted
- pNewElement->m_bIsRemoved = true;
+ xNewElement->m_bIsRemoved = true;
}
- m_aChildrenVector.push_back( pNewElement );
+ m_aChildrenVector.push_back(xNewElement.release());
}
}
catch( const container::NoSuchElementException& rNoSuchElementException )