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>
This commit is contained in:
parent
4a037e86d4
commit
b487a7929d
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user