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:
> printf("restarting parser.\n");
>
> //xml_parser_destroy( the_session );
>
> xml_parser_init( the_session );

-------------------------------------------------
Hello Dan!


I was wonderung if you also call the destroy
method the very first time with no parser
instance existing yet. Since XML_Parser
is a pointer type

   typedef struct XML_ParserStruct *XML_Parser;

a call to xml_parser_destroy on a session
with an uninitialized XML_Parser member would
call free() on a broken pointer. Just an idea.

If that's not the guilty part the only other
thing I can offer you is a workaround calling
XML_ParserReset on the old parser and then
reusing it.

Good luck!



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.