From e4bf6e360d6a744ff8a8bb1c38278f7572967b51 Mon Sep 17 00:00:00 2001 From: JayXon Date: Fri, 26 Dec 2014 01:00:24 -0500 Subject: [PATCH] Only check ele pointer once --- tinyxml2.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tinyxml2.cpp b/tinyxml2.cpp index 7b975c9..fd00194 100755 --- a/tinyxml2.cpp +++ b/tinyxml2.cpp @@ -862,19 +862,19 @@ char* XMLNode::ParseDeep( char* p, StrPair* parentEnd ) } 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 ) { + // 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; if ( endTag.Empty() && ele->ClosingType() == XMLElement::OPEN ) { mismatch = true;