diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-03-02 03:24:19 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-03-02 06:51:57 +0100 |
commit | a935faad11d5306631ac746ea5febaf06822bc66 (patch) | |
tree | 143ce97f85137d3059031c62bf550691378dfbdc /svtools | |
parent | aed9755db3de7b53cdf227c7cbcb782568649fac (diff) |
coverity#736572: possible memory leak and memory corruption + docu
Change-Id: I2f1aad214481903866cd496542d961245fae47d1
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/graphic/grfmgr2.cxx | 10 | ||||
-rw-r--r-- | svtools/source/graphic/provider.cxx | 5 |
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: |