[Expat-discuss] XML_ParserReset and memory leak??

Ajit Dias ajit_dias@hotmail.com
Fri Aug 16 18:19:02 2002


Hi,

I using the XML_ParseReset function and seeing a memory leak. I am not sure 
if I am using it incorrecly or if there is a bug. The leak can be observed 
by using the windows task Manager. Below is a simple sample application. 
Thanks for your feedback.

Expat version: 1.95.4
Platform: win200

ajit


include <string.h>
#include "expat.h"

char buffer[] = "<?xml version=\"1.0\"?><request 
version=\"1.00\"></request>";

void main()
{
   XML_Parser parser = XML_ParserCreate(NULL);

   while ( true )
   {
      int ret = XML_Parse( parser, buffer, strlen(buffer ), 1);
      if( ret == 0 )
      {
         abort();
      }

      ret = XML_ParserReset( parser, NULL );
      if( ret == 0 )
      {
         abort();
      }
   }
}

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx