[libvirt] [PATCH] network_conf.c: Free xmlDoc after use

Michal Privoznik mprivozn at redhat.com
Fri Feb 8 14:26:04 UTC 2013


The virNetworkObjUpdateParseFile() function was not freeing the xml
variable, leaving us with a memory leak.
---
 src/conf/network_conf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index c93916d..3604ff7 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -1895,6 +1895,7 @@ virNetworkObjUpdateParseFile(const char *filename,
     ret = 0;
 
 cleanup:
+    xmlFreeDoc(xml);
     xmlXPathFreeContext(ctxt);
     return ret;
 }
-- 
1.8.0.2




More information about the libvir-list mailing list