summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-10-30 22:29:37 +0100
committerJulien Nabet <serval2412@yahoo.fr>2017-10-31 09:28:53 +0100
commitc2b018b94408703aef4e5d3429a9c0ab826f5b7c (patch)
treef9934980fc214a2c5934dbec52093262d098a86d /vcl/source
parent2891ee3e4e8b7e1b519de99ae74603c0197a2e40 (diff)
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 <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/edit/textdoc.cxx3
1 files changed, 1 insertions, 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--;