From 37f62f86aff64b94ca4a8cb34df6cfda216da3bf Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 2 Oct 2014 11:13:28 +0100 Subject: coverity#1242496 Resource leak Change-Id: I419b217df306d41ed99e603bae9381f54c633598 --- sd/source/core/drawdoc3.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sd') diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 480a1d71cc31..e379ed0e9717 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -1571,10 +1571,12 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum, DBG_ASSERT(bTest, "Renaming StyleSheet failed."); pMySheet->GetItemSet().ClearItem(0); // Delete all - StyleSheetUndoAction* pUndoChStyle = new StyleSheetUndoAction(this, - pMySheet, &pHisSheet->GetItemSet()); if (bUndo) + { + StyleSheetUndoAction* pUndoChStyle = new StyleSheetUndoAction(this, + pMySheet, &pHisSheet->GetItemSet()); pUndoMgr->AddUndoAction(pUndoChStyle); + } pMySheet->GetItemSet().Put(pHisSheet->GetItemSet()); pMySheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); } -- cgit