summaryrefslogtreecommitdiffstats
path: root/src/xml
diff options
context:
space:
mode:
authorZou Ya <zouya@uniontech.com>2021-03-03 10:57:32 +0800
committerZou Ya <zouya@uniontech.com>2021-03-03 20:52:45 +0800
commitb487a7929d0f16c82a95e37d13de4651d92214cc (patch)
tree448bd633f4b3f0d3cf47f1d2807bac6d555bc969 /src/xml
parent4a037e86d4d2808634294daa7adb9d7523dfa3b9 (diff)
The condition 'if(oldChild)' is redundant
Either the condition 'if(oldChild)' is redundant or there is possible null pointer dereference: oldChild. Pick-to: 6.1 Change-Id: I28971cfa33294679ddd325158669b422b3a1c2eb Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/xml')
-rw-r--r--src/xml/dom/qdom.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp
index b7c676dd09..658140f062 100644
--- a/src/xml/dom/qdom.cpp
+++ b/src/xml/dom/qdom.cpp
@@ -1261,8 +1261,7 @@ QDomNodePrivate* QDomNodePrivate::replaceChild(QDomNodePrivate* newChild, QDomNo
newChild->last = nullptr;
// We are no longer interested in the old node
- if (oldChild)
- oldChild->ref.deref();
+ oldChild->ref.deref();
return oldChild;
}
@@ -1295,8 +1294,7 @@ QDomNodePrivate* QDomNodePrivate::replaceChild(QDomNodePrivate* newChild, QDomNo
oldChild->prev = nullptr;
// We are no longer interested in the old node
- if (oldChild)
- oldChild->ref.deref();
+ oldChild->ref.deref();
return oldChild;
}