summaryrefslogtreecommitdiffstats
path: root/src/xml/dom/qdom.cpp
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2024-03-01 22:02:47 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-03-05 17:05:41 +0000
commit4efc8dd8d026d7b31d0e5411d687d28a22fb6671 (patch)
tree113af19932ac7fada814be42edff2cdb3d71604c /src/xml/dom/qdom.cpp
parent68cf23f2f8ac4db63cce2068e7f9be548515c657 (diff)
QtXml: fix leak in QDomText::splitText
QDomText::splitText() needs to unref() the newly created QDomText instance as it does not use it by itself Pick-to: 6.5 6.2 5.15 Fixes: QTBUG-40561 Change-Id: I593011b63c39f2310204d97ec61da7cf78a0fc14 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit de0230467c1f658232b101a99e62d68992173592) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 975fc3da70ee83410876a205a2ebfbf25dd27e30)
Diffstat (limited to 'src/xml/dom/qdom.cpp')
-rw-r--r--src/xml/dom/qdom.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index 6959b634be..721981fd80 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -4671,6 +4671,10 @@ QDomTextPrivate* QDomTextPrivate::splitText(int offset)
value.truncate(offset);
parent()->insertAfter(t, this);
+ Q_ASSERT(t->ref.loadRelaxed() == 2);
+
+ // We are not interested in this node
+ t->ref.deref();
return t;
}