[Libreoffice-commits] core.git: sw/source

Caolán McNamara caolanm at redhat.com
Fri Mar 15 05:55:15 PDT 2013


 sw/source/core/text/pormulti.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 303cb25751373743b978a5da9c6c2d6d1d0dda3d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 15 12:54:34 2013 +0000

    Resolves: coverity#705746 resource leak
    
    Change-Id: I379f8bd780f40169ed7c70c7c5a28277091b978e

diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index 12cd6e7..e99fcc9 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -740,16 +740,16 @@ void SwRubyPortion::_Adjust( SwTxtFormatInfo &rInf )
     {
         if( !pCurr->GetPortion() )
             pCurr->SetPortion( new SwTxtPortion( *pCurr ) );
-        SwMarginPortion *pMarg = new SwMarginPortion( 0 );
         if( nLeft )
         {
+            SwMarginPortion *pMarg = new SwMarginPortion( 0 );
             pMarg->AddPrtWidth( nLeft );
             pMarg->SetPortion( pCurr->GetPortion() );
             pCurr->SetPortion( pMarg );
         }
         if( nRight )
         {
-            pMarg = new SwMarginPortion( 0 );
+            SwMarginPortion *pMarg = new SwMarginPortion( 0 );
             pMarg->AddPrtWidth( nRight );
             pCurr->FindLastPortion()->Append( pMarg );
         }


More information about the Libreoffice-commits mailing list