Fix memory leak of xml parser context

This commit is contained in:
Daniel P. Berrange 2006-11-10 23:46:12 +00:00
parent bb1ff5e7f8
commit c41481197d
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,7 @@
Fri Nov 10 17:53:41 EDT 2006 Daniel Berrange <berrange@redhat.com>
* src/xml.c: Fix memory leak, by freeing xmlParserContextPtr object
Fri Nov 10 11:19:32 CET 2006 Daniel Veillard <veillard@redhat.com>
* src/xend_internal.c src/xml.c: add an extra element currentMemory

View File

@ -1385,6 +1385,7 @@ virDomainParseXMLDesc(const char *xmldesc, char **name, int xendConfigVersion)
xmlXPathFreeContext(ctxt);
xmlFreeDoc(xml);
xmlFreeParserCtxt(pctxt);
if (name != NULL)
*name = nam;
@ -1404,6 +1405,8 @@ virDomainParseXMLDesc(const char *xmldesc, char **name, int xendConfigVersion)
xmlXPathFreeContext(ctxt);
if (xml != NULL)
xmlFreeDoc(xml);
if (pctxt != NULL)
xmlFreeParserCtxt(pctxt);
if (ret != NULL)
free(ret);
return (NULL);