[virt-tools-list] [PATCH virt-viewer] ovirt-foreign-menu: Plug memory leak
Eduardo Lima (Etrunko)
etrunko at redhat.com
Wed Aug 28 21:18:02 UTC 2019
Error caught by valgrind, the OvirtCollection object created in function
ovirt_foreign_menu_fetch_vm_async() was never freed.
433 (40 direct, 393 indirect) bytes in 1 blocks are definitely lost in loss record 16,708 of 17,677
at 0x5868FDF: g_type_create_instance (in /usr/lib64/libgobject-2.0.so.0.6000.6)
by 0x584B42C: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
by 0x584D347: g_object_new_valist (in /usr/lib64/libgobject-2.0.so.0.6000.6)
by 0x584D69C: g_object_new (in /usr/lib64/libgobject-2.0.so.0.6000.6)
by 0x558E823: ovirt_collection_new (ovirt-collection.c:304)
by 0x558E98C: ovirt_sub_collection_new_from_resource_search (ovirt-collection.c:375)
by 0x42D510: ovirt_foreign_menu_fetch_vm_async (ovirt-foreign-menu.c:994)
by 0x42D510: ovirt_foreign_menu_next_async_step (ovirt-foreign-menu.c:316)
by 0x42D70D: api_fetched_cb (ovirt-foreign-menu.c:1025)
by 0x570BC19: ??? (in /usr/lib64/libgio-2.0.so.0.6000.6)
by 0x570C7EC: ??? (in /usr/lib64/libgio-2.0.so.0.6000.6)
by 0x559005D: call_async_cb (ovirt-proxy.c:279)
by 0x55B5A07: ??? (in /usr/lib64/librest-0.7.so.0.0.0)
Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
---
src/ovirt-foreign-menu.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/ovirt-foreign-menu.c b/src/ovirt-foreign-menu.c
index 190bb3b..98ab7b9 100644
--- a/src/ovirt-foreign-menu.c
+++ b/src/ovirt-foreign-menu.c
@@ -888,7 +888,7 @@ static void vms_fetched_cb(GObject *source_object,
g_debug("failed to fetch VM list: %s", error->message);
g_task_return_error(task, error);
g_object_unref(task);
- return;
+ goto end;
}
g_hash_table_iter_init(&iter, ovirt_collection_get_resources(collection));
@@ -911,6 +911,9 @@ static void vms_fetched_cb(GObject *source_object,
"Could not find a VM with guid \"%s\"", menu->priv->vm_guid);
g_object_unref(task);
}
+
+end:
+ g_object_unref(collection);
}
--
2.21.0
More information about the virt-tools-list
mailing list