From 32fcb0c4f56deb8813340d88d0638e1960851a06 Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 28 Feb 2013 07:57:57 +0100 Subject: coverity#705636: fix memory leak Change-Id: Iabb4922aedd6f2897e005797e6d2ae1fea11ac4a --- cui/source/dialogs/hltpbase.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cui') diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index 1d040b48c039..89e37b5215a3 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -30,6 +30,7 @@ #include "macroass.hxx" #include #include +#include using namespace ::ucbhelper; @@ -49,11 +50,11 @@ SvxFramesComboBox::SvxFramesComboBox ( Window* pParent, const ResId& rResId, SfxDispatcher* pDispatch ) : ComboBox (pParent, rResId) { - TargetList* pList = new TargetList; SfxViewFrame* pViewFrame = pDispatch ? pDispatch->GetFrame() : 0; SfxFrame* pFrame = pViewFrame ? &pViewFrame->GetTopFrame() : 0; if ( pFrame ) { + boost::scoped_ptr pList(new TargetList); pFrame->GetTargetList(*pList); if( !pList->empty() ) { -- cgit