[virt-tools-list] [libosinfo 2/2] loader: Fix one newly introduced leak

Christophe Fergeau cfergeau at redhat.com
Fri Dec 7 08:30:07 UTC 2012


This is a follow-up to my previous series fixing leaks as a similar
one was just introduced.
---
 osinfo/osinfo_loader.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c
index 62b92f9..e630793 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -961,8 +961,10 @@ static OsinfoDeviceDriver *osinfo_loader_driver(OsinfoLoader *loader,
     }
 
     gint nnodes = osinfo_loader_nodeset("./*", ctxt, &nodes, err);
-    if (error_is_set(err))
+    if (error_is_set(err)) {
+        g_object_unref(G_OBJECT(driver));
         return NULL;
+    }
 
     for (i = 0 ; i < nnodes ; i++) {
         if (nodes[i]->children &&
-- 
1.8.0.1




More information about the virt-tools-list mailing list