[Expat-discuss] Heap corruption after successive XML_ParserFree/XML_ParserCreate calls

Sebastian Pipping webmaster at hartwork.org
Mon Jul 23 20:39:50 CEST 2007


Dan Clusin wrote:
> Would XML_ParserReset destroy all of the state currently
> associated with the Current XML document? That's really
> all I'm looking for. I don't really care if the parser
> is actually destroyed and re-initialised. So long as no
> data From the previous XML document could potentially
> futs up the current document being parsed.

-----------------------------------------------
Yes, that's what it does:

XML_Bool XMLCALL
XML_ParserReset(XML_Parser p,
                const XML_Char *encoding);

"Clean up the memory structures maintained by the parser so that it may be used
again. After this has been called, parser is ready to start parsing a new
document. All handlers are cleared from the parser, except for the
unknownEncodingHandler. The parser's external state is re-initialized except for
the values of ns and ns_triplets. This function may not be used on a parser
created using XML_ExternalEntityParserCreate; it will return XML_FALSE in that
case. Returns XML_TRUE on success. Your application is responsible for dealing
with any memory associated with user data."



Sebastian



More information about the Expat-discuss mailing list