From 500074a10f4b1b50f6b7d6a430a4deded976895e Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 23 Jan 2007 06:54:29 +0000 Subject: [PATCH] error check --- stepmania/src/XmlFileUtil.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stepmania/src/XmlFileUtil.cpp b/stepmania/src/XmlFileUtil.cpp index 34ddb775a2..4afdc0d863 100644 --- a/stepmania/src/XmlFileUtil.cpp +++ b/stepmania/src/XmlFileUtil.cpp @@ -319,6 +319,12 @@ unsigned LoadInternal( XNode *pNode, const RString &xml, RString &sErrorOut, uns XNode *node = new XNode; iOffset = LoadInternal( node, xml, sErrorOut, iOffset ); + if( iOffset == string::npos ) + { + delete node; + return iOffset; + } + if( !node->GetName().empty() ) { DEBUG_ASSERT( node->GetName().size() );