Re: [xml] Strange memory leak in libxml2-2.4.8 (may be in libxslt-1.0.6)



On Fri, Nov 09, 2001 at 12:02:06AM +0300, Lev Serebryakov wrote:
int main(int argn, char *argv[])
{
    xmlDocPtr doc;

    xmlInitMemory();
    doc = xmlParseFile("empty.xml");
    xmlFreeDoc(doc);
    xmlMemoryDump();
}
0          42      4 malloc()  in none(0) "amp"
1          41     20 malloc()  in none(0) pointer to #42 at index 4
2          40      2 malloc()  in none(0) "&"
3          39      4 malloc()  in none(0) "amp"
39          3     20 malloc()  in none(0) pointer to #2 at index 0
40          2      6 strdup()  in none(0) "UTF-8"
41          1    200 malloc()  in none(0) pointer to #3 at index 0
  It seems, xmlInitParser() and xmlCleanupParser() will help me.

  this obviously misses xmlCleanupParser(), and those blocks are
allocated to initialize the library state, that's all...

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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