Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/2711
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/11/2711/1
coverity#705733: Resource leak
+ Fix "if" format
Change-Id: Iafd46d21e5b9ed21d7c7c338502d780be9f0c222
---
M svx/source/svdraw/svdundo.cxx
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 7f310ee..19f6098 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -1121,14 +1121,13 @@
if (!bNewTextAvailable)
AfterSetText();
- // copy text for Undo, because the original now belongs to SetOutlinerParaObject()
- OutlinerParaObject* pText1 = pOldText;
- if(pText1)
- pText1 = new OutlinerParaObject(*pText1);
-
SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText);
- if( pText )
+ if (pText && pOldText)
+ {
+ // copy text for Undo, because the original now belongs to SetOutlinerParaObject()
+ OutlinerParaObject* pText1 = new OutlinerParaObject(*pOldText);
pText->SetOutlinerParaObject(pText1);
+ }
pObj->SetEmptyPresObj( bEmptyPresObj );
pObj->ActionChanged();
@@ -1137,7 +1136,7 @@
void SdrUndoObjSetText::Redo()
{
SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText);
- if( pText && pNewText)
+ if (pText && pNewText)
{
// copy text for Undo, because the original now belongs to SetOutlinerParaObject()
OutlinerParaObject* pText1 = new OutlinerParaObject(*pNewText);
--
To view, visit https://gerrit.libreoffice.org/2711
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iafd46d21e5b9ed21d7c7c338502d780be9f0c222
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Julien Nabet <serval2412@yahoo.fr>
Context
- [PATCH] coverity#705733: Resource leak · Julien Nabet (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.