From 6e29f56895cd38aa7dee85112370a7cfc0d24632 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Wed, 13 Mar 2013 21:06:52 +0100 Subject: coverity#705732: Resource leak Change-Id: I926c3cbe25b7b4310d67a8f9e96b4a98e61b26e0 --- svx/source/svdraw/svdundo.cxx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'svx') diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index c1e4b4dd1ff9..7f310ee349c5 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -1136,16 +1136,13 @@ void SdrUndoObjSetText::Undo() void SdrUndoObjSetText::Redo() { - // copy text for Undo, because the original now belongs to SetOutlinerParaObject() - OutlinerParaObject* pText1 = pNewText; - - if(pText1) - pText1 = new OutlinerParaObject(*pText1); - SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText); - if( pText ) + if( pText && pNewText) + { + // copy text for Undo, because the original now belongs to SetOutlinerParaObject() + OutlinerParaObject* pText1 = new OutlinerParaObject(*pNewText); static_cast< SdrTextObj* >( pObj )->NbcSetOutlinerParaObjectForText( pText1, pText ); - + } pObj->ActionChanged(); // Trigger PageChangeCall -- cgit