mirror of
https://github.com/AxioDL/tinyxml2.git
synced 2025-05-14 19:31:23 +00:00
Only check ele pointer once
This commit is contained in:
parent
69242c4b9b
commit
e4bf6e360d
24
tinyxml2.cpp
24
tinyxml2.cpp
@ -862,19 +862,19 @@ char* XMLNode::ParseDeep( char* p, StrPair* parentEnd )
|
|||||||
}
|
}
|
||||||
|
|
||||||
XMLElement* ele = node->ToElement();
|
XMLElement* ele = node->ToElement();
|
||||||
// We read the end tag. Return it to the parent.
|
|
||||||
if ( ele && ele->ClosingType() == XMLElement::CLOSING ) {
|
|
||||||
if ( parentEnd ) {
|
|
||||||
ele->_value.TransferTo( parentEnd );
|
|
||||||
}
|
|
||||||
node->_memPool->SetTracked(); // created and then immediately deleted.
|
|
||||||
DeleteNode( node );
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Handle an end tag returned to this level.
|
|
||||||
// And handle a bunch of annoying errors.
|
|
||||||
if ( ele ) {
|
if ( ele ) {
|
||||||
|
// We read the end tag. Return it to the parent.
|
||||||
|
if ( ele->ClosingType() == XMLElement::CLOSING ) {
|
||||||
|
if ( parentEnd ) {
|
||||||
|
ele->_value.TransferTo( parentEnd );
|
||||||
|
}
|
||||||
|
node->_memPool->SetTracked(); // created and then immediately deleted.
|
||||||
|
DeleteNode( node );
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Handle an end tag returned to this level.
|
||||||
|
// And handle a bunch of annoying errors.
|
||||||
bool mismatch = false;
|
bool mismatch = false;
|
||||||
if ( endTag.Empty() && ele->ClosingType() == XMLElement::OPEN ) {
|
if ( endTag.Empty() && ele->ClosingType() == XMLElement::OPEN ) {
|
||||||
mismatch = true;
|
mismatch = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user