sw/source/filter/ww8/rtfexport.cxx |    3 +--
 sw/source/filter/ww8/rtfexport.hxx |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 9267e9fbd2ad1a05986f7ce16d4fef28cf7f08fb
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue May 11 10:04:47 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Tue May 11 14:21:25 2021 +0200

    fix leak in RtfExport
    
    Change-Id: I6e1059cef9032de36cf8e1ac56eefecc4e417337
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115384
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/filter/ww8/rtfexport.cxx 
b/sw/source/filter/ww8/rtfexport.cxx
index 4b4712a7bf09..c7be2d080d0a 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -731,7 +731,7 @@ ErrCode RtfExport::ExportDocument_Impl()
     }
 
     // Init sections
-    m_pSections = new MSWordSections(*this);
+    m_pSections.reset(new MSWordSections(*this));
 
     // Page description
     WritePageDescTable();
@@ -1031,7 +1031,6 @@ RtfExport::RtfExport(RtfExportFilter* pFilter, SwDoc& 
rDocument,
     : MSWordExportBase(rDocument, pCurrentPam, &rOriginalPam)
     , m_pFilter(pFilter)
     , m_pWriter(pWriter)
-    , m_pSections(nullptr)
     , m_bOutOutlineOnly(bOutOutlineOnly)
     , m_eDefaultEncoding(
           
rtl_getTextEncodingFromWindowsCharset(sw::ms::rtl_TextEncodingToWinCharset(DEF_ENCODING)))
diff --git a/sw/source/filter/ww8/rtfexport.hxx 
b/sw/source/filter/ww8/rtfexport.hxx
index 9b33c1304659..105f6305eba2 100644
--- a/sw/source/filter/ww8/rtfexport.hxx
+++ b/sw/source/filter/ww8/rtfexport.hxx
@@ -43,7 +43,7 @@ class RtfExport : public MSWordExportBase
     std::unique_ptr<RtfAttributeOutput> m_pAttrOutput;
 
     /// Sections/headers/footers
-    MSWordSections* m_pSections;
+    std::unique_ptr<MSWordSections> m_pSections;
 
     std::unique_ptr<RtfSdrExport> m_pSdrExport;
     bool m_bOutOutlineOnly;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to