Re: Heap corruption after successive XML_ParserFree/XML_ParserCreate calls

Sebastian Pipping <[email protected]>
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.