From c2b018b94408703aef4e5d3429a9c0ab826f5b7c Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Mon, 30 Oct 2017 22:29:37 +0100 Subject: tdf#113519: fix crash by releasing returned unique_ptr Regression from https://cgit.freedesktop.org/libreoffice/core/commit/?id=19910c461230f70bb9e98ad44db3525f0d755724 tdf#112658: fix leak when calling TextEngine::SetAttrib Change-Id: Iee82196ca10d82e898d8806a11874c3bedc28895 Reviewed-on: https://gerrit.libreoffice.org/44077 Reviewed-by: Julien Nabet Tested-by: Julien Nabet --- vcl/source/edit/textdoc.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vcl/source/edit/textdoc.cxx b/vcl/source/edit/textdoc.cxx index 8734ea6e5705..267d774818d3 100644 --- a/vcl/source/edit/textdoc.cxx +++ b/vcl/source/edit/textdoc.cxx @@ -328,8 +328,7 @@ TextNode* TextNode::Split( sal_Int32 nPos ) SAL_WARN_IF( rAttrib.GetStart() < nPos, "vcl", "Start < nPos!" ); SAL_WARN_IF( rAttrib.GetEnd() < nPos, "vcl", "End < nPos!" ); // move all into the new node (this) - maCharAttribs.RemoveAttrib( nAttr ); - pNew->maCharAttribs.InsertAttrib( &rAttrib ); + pNew->maCharAttribs.InsertAttrib(maCharAttribs.RemoveAttrib(nAttr).release()); rAttrib.GetStart() = rAttrib.GetStart() - nPos; rAttrib.GetEnd() = rAttrib.GetEnd() - nPos; nAttr--; -- cgit v1.2.3