[libgovirt] collection: Fix leak on duplicate resource names
- From: Christophe Fergeau <teuf src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgovirt] collection: Fix leak on duplicate resource names
- Date: Wed, 13 Apr 2016 13:47:08 +0000 (UTC)
commit 4afb3ffdea45ab8d40aed7265ede1df59eb53de2
Author: Christophe Fergeau <cfergeau redhat com>
Date: Wed Apr 13 15:28:54 2016 +0200
collection: Fix leak on duplicate resource names
When a collection contains 2 resources with the same name, we were
correctly releasing the memory associated with the colliding resource,
but not its name.
govirt/ovirt-collection.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/govirt/ovirt-collection.c b/govirt/ovirt-collection.c
index 3bbdffe..a3b0f3f 100644
--- a/govirt/ovirt-collection.c
+++ b/govirt/ovirt-collection.c
@@ -293,6 +293,7 @@ ovirt_collection_refresh_from_xml(OvirtCollection *collection,
g_message("'%s' resource with the same name ('%s') already exists",
collection->priv->resource_xml_name, name);
g_object_unref(G_OBJECT(resource));
+ g_free(name);
continue;
}
g_hash_table_insert(resources, name, resource);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]