Re: Heap corruption after successive XML_ParserFree/XML_ParserCreate calls
"Dan Clusin" <[email protected]>
| Newsgroups | gmane.text.xml.expat.general |
|---|---|
| Message-ID | <97948279523F1A4CA9C0ADE3ED520898C2093C@webmail> |
I'm fairly sure that is not the issue, however I will investigate further. That doesn't seem to be the case because the variable for the conditional Surrounding the restarting of the parser is only set to true once SSL setup Has been completed. It is set to false at the beginning of the progam (main) and is currently only single threaded. 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. Regards, Dan -----Original Message----- From: Sebastian Pipping [mailto:[email protected]] Sent: Sunday, July 22, 2007 11:50 AM To: Dan Clusin Cc: [email protected] Subject: Re: [Expat-discuss] Heap corruption after successive XML_ParserFree/XML_ParserCreate calls 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