sw/source/core/layout/sectfrm.cxx |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 61a0ed0a8d34207e153cb2acf9bb29bf2e500a3c
Author:     Caolán McNamara <[email protected]>
AuthorDate: Thu Mar 5 23:43:28 2026 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Fri Mar 6 09:27:42 2026 +0100

    ofz#490136913 Direct-leak
    
    this went wrong in:
    
    commit ab7c81f55621d7b0d1468c63305163016dd78837
    Date:   Wed Oct 4 15:42:27 2023 +0200
    
        ITEM: Get away from classic 'poolable' Item flag
    
    where the old pointer compare thing to detect this was a temp
    object to destroy was misidentied as something more complicated.
    
    Change-Id: Ica2fad036d5da54c5ebfeb2de5278b85db8f6247
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/201080
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sw/source/core/layout/sectfrm.cxx 
b/sw/source/core/layout/sectfrm.cxx
index 7a331d3d9fce..a175ed070f57 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -147,10 +147,15 @@ void SwSectionFrame::Init()
     const SwFormatCol &rCol = GetFormat()->GetCol();
     if( ( rCol.GetNumCols() > 1 || IsAnyNoteAtEnd() ) && !IsInFootnote() )
     {
-        const SwFormatCol *pOld = Lower() ? &rCol : new SwFormatCol;
-        ChgColumns( *pOld, rCol, IsAnyNoteAtEnd() );
-        if (!SfxPoolItem::areSame( pOld, &rCol ))
-            delete pOld;
+        if (Lower())
+        {
+            ChgColumns( rCol, rCol, IsAnyNoteAtEnd() );
+        }
+        else
+        {
+            SwFormatCol aOld;
+            ChgColumns( aOld, rCol, IsAnyNoteAtEnd() );
+        }
     }
 }
 

Reply via email to