summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-03-02 03:24:19 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-03-02 06:51:57 +0100
commita935faad11d5306631ac746ea5febaf06822bc66 (patch)
tree143ce97f85137d3059031c62bf550691378dfbdc /svtools
parentaed9755db3de7b53cdf227c7cbcb782568649fac (diff)
coverity#736572: possible memory leak and memory corruption + docu
Change-Id: I2f1aad214481903866cd496542d961245fae47d1
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/graphic/grfmgr2.cxx10
-rw-r--r--svtools/source/graphic/provider.cxx5
2 files changed, 9 insertions, 6 deletions
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index fd8679e8a8c4..329e34d88848 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -1311,15 +1311,17 @@ sal_Bool GraphicManager::ImplCreateOutput( OutputDevice* pOut,
}
if ( pModAct )
{
- rOutMtf.ReplaceAction( pModAct, nCurPos );
- pAct->Delete();
+ MetaAction* pDeleteAction = rOutMtf.ReplaceAction( pModAct, nCurPos );
+ assert(pDeleteAction);
+ pDeleteAction->Delete();
}
else
{
if( pAct->GetRefCount() > 1 )
{
- rOutMtf.ReplaceAction( pModAct = pAct->Clone(), nCurPos );
- pAct->Delete();
+ MetaAction* pDeleteAction = rOutMtf.ReplaceAction( pModAct = pAct->Clone(), nCurPos );
+ assert(pDeleteAction);
+ pDeleteAction->Delete();
}
else
pModAct = pAct;
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index 140708757c39..7148fa3568a4 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -742,8 +742,9 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal
else
pNewAction = new MetaBmpExScaleAction( aPos, aSize, aGraphic.GetBitmapEx() );
- aMtf.ReplaceAction( pNewAction, i );
- pAction->Delete();
+ MetaAction* pDeleteAction = aMtf.ReplaceAction( pNewAction, i );
+ if(pDeleteAction)
+ pDeleteAction->Delete();
break;
}
default: