sc/source/ui/view/formatsh.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 598c7deeb470a70e664a4c24c79563e831b28517
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Aug 17 11:30:45 2025 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun Aug 17 15:32:48 2025 +0200

    cid#1664821 Resource leak
    
    Change-Id: Id9b071d63a3245501bc3c5501279d290a44ea936
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189818
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index f0d89bd259e3..c702dd8f4545 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1060,7 +1060,8 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
             case SID_FRAME_LINESTYLE:
                 {
                     // Update default line
-                    const ::editeng::SvxBorderLine* pLine = new 
::editeng::SvxBorderLine();
+                    ::editeng::SvxBorderLine aLine;
+                    const ::editeng::SvxBorderLine* pLine = nullptr;
                     const SfxInt16Item* lineStyleItem = 
rReq.GetArg<SfxInt16Item>(FN_PARAM_1);
 
                     if (lineStyleItem)
@@ -1079,8 +1080,10 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
                         OuterLineWidth = OuterLineWidthItem ? 
OuterLineWidthItem->GetValue() : 0;
                         LineDistance = LineDistanceItem ? 
LineDistanceItem->GetValue() : 0;
 
-                        
const_cast<::editeng::SvxBorderLine*>(pLine)->GuessLinesWidths(
+                        aLine.GuessLinesWidths(
                             lineStyle, InnerLineWidth, OuterLineWidth, 
LineDistance);
+
+                        pLine = &aLine;
                     }
                     else
                     {

Reply via email to