[virt-tools-list] [libosinfo 3/4] loader: Don't leak 'arch'

Christophe Fergeau cfergeau at redhat.com
Thu Dec 6 09:53:59 UTC 2012


---
 osinfo/osinfo_loader.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index 606e413..bb7949e 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -729,6 +729,7 @@ static OsinfoMedia *osinfo_loader_media (OsinfoLoader *loader,
     };
 
     OsinfoMedia *media = osinfo_media_new(id, arch);
+    xmlFree(arch);
 
     osinfo_loader_entity(loader, OSINFO_ENTITY(media), keys, ctxt, root, err);
     if (live) {
@@ -798,6 +799,7 @@ static OsinfoTree *osinfo_loader_tree (OsinfoLoader *loader,
     };
 
     OsinfoTree *tree = osinfo_tree_new(id, arch);
+    xmlFree(arch);
 
     osinfo_loader_entity(loader, OSINFO_ENTITY(tree), keys, ctxt, root, err);
 
@@ -877,6 +879,7 @@ static OsinfoResources *osinfo_loader_resources(OsinfoLoader *loader,
 
 EXIT:
     g_free(nodes);
+    xmlFree(arch);
 
     return resources;
 }
-- 
1.8.0.1




More information about the virt-tools-list mailing list