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

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



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


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