diff options
author | David Tardon <dtardon@redhat.com> | 2011-05-16 14:04:04 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2011-05-16 15:39:29 +0200 |
commit | cea8b8375ea692bf243d5bb7debfebe9c7886c65 (patch) | |
tree | 356f311bf0555e9bc307c3a1dacaf79e34d9cd15 | |
parent | do not leak memory (diff) | |
download | core-cea8b8375ea692bf243d5bb7debfebe9c7886c65.tar.gz core-cea8b8375ea692bf243d5bb7debfebe9c7886c65.zip |
do not leak memory
-rw-r--r-- | editeng/source/items/xmlcnitm.cxx | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/editeng/source/items/xmlcnitm.cxx b/editeng/source/items/xmlcnitm.cxx index f672845ca486..470362c95207 100644 --- a/editeng/source/items/xmlcnitm.cxx +++ b/editeng/source/items/xmlcnitm.cxx @@ -119,7 +119,7 @@ bool SvXMLAttrContainerItem::PutValue( const com::sun::star::uno::Any& rVal, sal } else { - SvXMLAttrContainerData* pNewImpl = new SvXMLAttrContainerData; + std::auto_ptr<SvXMLAttrContainerData> pNewImpl(new SvXMLAttrContainerData); try { @@ -168,19 +168,12 @@ bool SvXMLAttrContainerItem::PutValue( const com::sun::star::uno::Any& rVal, sal } if( nAttr == nCount ) - { - delete pImpl; - pImpl = pNewImpl; - } + pImpl = pNewImpl.release(); else - { - delete pNewImpl; return false; - } } catch(...) { - delete pNewImpl; return false; } } |