[Expat-discuss] XML_ParserReset and memory leak??

Karl Waclawek karl@waclawek.net
Fri Aug 16 19:56:03 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();
>       }
>    }
> }

I guess I replied too quick. Rolf Ade pointed out to me
that what you are testing is increasing memory usage as
the loop progresses.

Have to look into, or maybe Rolf helps me out there. ;-)

Karl