[libvirt] [libvirt-sandbox] GVirSandboxConfigNetwork: Fix small finalize() leak

Christophe Fergeau cfergeau at redhat.com
Thu Nov 21 14:07:49 UTC 2013


The content of the 'addrs' and 'routes' lists is freed, but the list
themselves were not g_list_free()'ed
---
 libvirt-sandbox/libvirt-sandbox-config-network.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libvirt-sandbox/libvirt-sandbox-config-network.c b/libvirt-sandbox/libvirt-sandbox-config-network.c
index 555a360..eb6a569 100644
--- a/libvirt-sandbox/libvirt-sandbox-config-network.c
+++ b/libvirt-sandbox/libvirt-sandbox-config-network.c
@@ -131,7 +131,9 @@ static void gvir_sandbox_config_network_finalize(GObject *object)
     g_free(priv->source);
     g_free(priv->mac);
     g_list_foreach(priv->addrs, (GFunc)g_object_unref, NULL);
+    g_list_free(priv->addrs);
     g_list_foreach(priv->routes, (GFunc)g_object_unref, NULL);
+    g_list_free(priv->routes);
 
     G_OBJECT_CLASS(gvir_sandbox_config_network_parent_class)->finalize(object);
 }
-- 
1.8.4.2




More information about the libvir-list mailing list