sw/source/core/unocore/unocrsrhelper.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
New commits: commit 48d2013ff913fdd9552b81cbe8474211c1c90e50 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Jul 15 12:52:24 2019 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Jul 15 15:57:23 2019 +0200 ofz#15731 Direct-leak RedlineExtraData is copied Change-Id: I363c91125ecc78e746865cf1fba5913730e0d8e7 Reviewed-on: https://gerrit.libreoffice.org/75633 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 27427c5a3bea..84f20f7a3a60 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -1201,7 +1201,7 @@ void makeRedline( SwPaM const & rPaM, aRedlineData.SetTimeStamp( DateTime( aStamp)); } - SwRedlineExtraData_FormatColl * pRedlineExtraData = nullptr; + std::unique_ptr<SwRedlineExtraData_FormatColl> xRedlineExtraData; // Read the 'Redline Revert Properties' from the parameters uno::Sequence< beans::PropertyValue > aRevertProperties; @@ -1216,7 +1216,7 @@ void makeRedline( SwPaM const & rPaM, if (!aRevertProperties.hasElements()) { // to reject the paragraph style change, use standard style - pRedlineExtraData = new SwRedlineExtraData_FormatColl( "", RES_POOLCOLL_STANDARD, nullptr ); + xRedlineExtraData.reset(new SwRedlineExtraData_FormatColl( "", RES_POOLCOLL_STANDARD, nullptr )); } } else @@ -1303,10 +1303,10 @@ void makeRedline( SwPaM const & rPaM, if (eType == RedlineType::ParagraphFormat && sParaStyleName.isEmpty()) nStylePoolId = RES_POOLCOLL_STANDARD; - pRedlineExtraData = new SwRedlineExtraData_FormatColl( sParaStyleName, nStylePoolId, &aItemSet ); + xRedlineExtraData.reset(new SwRedlineExtraData_FormatColl( sParaStyleName, nStylePoolId, &aItemSet )); } else if (eType == RedlineType::ParagraphFormat) - pRedlineExtraData = new SwRedlineExtraData_FormatColl( "", RES_POOLCOLL_STANDARD, nullptr ); + xRedlineExtraData.reset(new SwRedlineExtraData_FormatColl( "", RES_POOLCOLL_STANDARD, nullptr )); } // to finalize DOCX import @@ -1316,7 +1316,8 @@ void makeRedline( SwPaM const & rPaM, SwRangeRedline* pRedline = new SwRangeRedline( aRedlineData, rPaM ); RedlineFlags nPrevMode = pRedlineAccess->GetRedlineFlags( ); - pRedline->SetExtraData( pRedlineExtraData ); + // xRedlineExtraData is copied here + pRedline->SetExtraData( xRedlineExtraData.get() ); pRedlineAccess->SetRedlineFlags_intern(RedlineFlags::On); auto const result(pRedlineAccess->AppendRedline(pRedline, false)); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits