summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2011-05-16 14:04:04 +0200
committerDavid Tardon <dtardon@redhat.com>2011-05-16 15:39:29 +0200
commitcea8b8375ea692bf243d5bb7debfebe9c7886c65 (patch)
tree356f311bf0555e9bc307c3a1dacaf79e34d9cd15 /editeng
parentcde8ea43fa8cf82a182df50d8eda3413bcf30e2b (diff)
do not leak memory
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/items/xmlcnitm.cxx11
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;
}
}