summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-02-28 08:15:52 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-02-28 10:53:12 +0100
commitb65335564647705092d58dc0e9de92fb01c6262a (patch)
treee6671aaaa311081e98ba1eab10e0fbdcf212774a
parentf4bb6d7cb5751c22bcba99ffe926d7b645902ae2 (diff)
coverity#705637: fix memory leak and add documentation
Change-Id: If06ef8c78a7d3910be3f3d46dca090a4568b5fe7
-rw-r--r--cui/source/tabpages/chardlg.cxx3
-rw-r--r--sfx2/inc/sfx2/bindings.hxx3
2 files changed, 5 insertions, 1 deletions
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 7048be1bf667..b7f0e7f701b4 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1359,7 +1359,7 @@ void SvxCharEffectsPage::Initialize()
m_pFontColorLB->SetUpdateMode( sal_False );
{
- SfxPoolItem* pDummy;
+ SfxPoolItem* pDummy = NULL;
SfxViewFrame* pFrame = SfxViewFrame::GetFirst( pDocSh );
if ( !pFrame ||
SFX_ITEM_DEFAULT > pFrame->GetBindings().QueryState( SID_ATTR_AUTO_COLOR_INVALID, pDummy ) )
@@ -1368,6 +1368,7 @@ void SvxCharEffectsPage::Initialize()
m_pOverlineColorLB->InsertAutomaticEntryColor( Color( COL_AUTO ) );
m_pFontColorLB->InsertAutomaticEntryColor( Color( COL_AUTO ) );
}
+ delete pDummy;
}
for ( long i = 0; i < pColorTable->Count(); i++ )
{
diff --git a/sfx2/inc/sfx2/bindings.hxx b/sfx2/inc/sfx2/bindings.hxx
index a13497566aa0..73fce08a118e 100644
--- a/sfx2/inc/sfx2/bindings.hxx
+++ b/sfx2/inc/sfx2/bindings.hxx
@@ -151,6 +151,9 @@ public:
const SfxSlot* GetSlot( sal_uInt16 nMsgId );
SfxStateCache* GetStateCache( sal_uInt16 nId, sal_uInt16 *pPos = 0 );
SAL_DLLPRIVATE SfxStateCache* GetAnyStateCache_Impl( sal_uInt16 nId );
+ /**
+ * @param rpState the caller has to delete the pointer
+ */
SfxItemState QueryState( sal_uInt16 nSID, SfxPoolItem* &rpState );
const SfxPoolItem* ExecuteSynchron( sal_uInt16 nSlot,