Re: [libxml++] memory leak in SaxParser



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Le Mercredi 23 Avril 2003 18:04, thierry a écrit :
> I have encountered a memory leak (not signalized by Purify) in the class
> SaxParser. in the function parse() :
>
> "_context->sax = & _sax_handler;
>
> [..]
>
> release_underlying();"
>
> is not valid. structure allocated in xmlCreateMemoryParserCtxt for the sax
> handler is never released due to
>
> "_context->sax = 0 " in release_underlying().
>


Thanks for reporting this problem.

In fact the good solution is probably to use xmlSAXUserParseFile and 
xmlSAXUserParseMemory to create the contexts, and not 
xmlCreateMemoryParserCtxt and xmlCreateFileParserCtxt which are to be used 
only for DOM.

I'll commit a patch by the evening.


Best regards,

Christophe
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+psdLB+sU3TyOQjARAkp2AJ9gnVSX/K/WP8R/SVH2y7YHRot7fwCgt5rY
7oTxeM09/oC9XgOpsHrTt00=
=ko17
-----END PGP SIGNATURE-----





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]