aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib/client.c
diff options
context:
space:
mode:
authorChris Coulson <chrisccoulson@ubuntu.com>2011-03-10 00:43:07 +0000
committerChris Coulson <chrisccoulson@ubuntu.com>2011-03-10 00:43:07 +0000
commitec307704b44db4f65f3534f23cfdf517c883a9e1 (patch)
tree878c02659ae6060788a5a2d38e7fe558357bebf5 /libdbusmenu-glib/client.c
parentda12001cce940316c26b8dc68da507f62ea689a7 (diff)
downloadlibdbusmenu-ec307704b44db4f65f3534f23cfdf517c883a9e1.tar.gz
libdbusmenu-ec307704b44db4f65f3534f23cfdf517c883a9e1.tar.bz2
libdbusmenu-ec307704b44db4f65f3534f23cfdf517c883a9e1.zip
Fix various memory leaks
Diffstat (limited to 'libdbusmenu-glib/client.c')
-rw-r--r--libdbusmenu-glib/client.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 61253e2..5ca52f4 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -1213,7 +1213,9 @@ menuproxy_signal_cb (GDBusProxy * proxy, gchar * sender, gchar * signal, GVarian
while (g_variant_iter_next(&properties, "s", &property)) {
/* g_debug("Removing property '%s' on %d", property, id); */
dbusmenu_menuitem_property_remove(menuitem, property);
+ g_free(property);
}
+ g_variant_unref(ritem);
}
GVariantIter items;
@@ -1304,12 +1306,11 @@ menuitem_get_properties_replace_cb (GVariant * properties, GError * error, gpoin
have_error = TRUE;
}
- GList * current_props = NULL;
+ GList * current_props = dbusmenu_menuitem_properties_list(DBUSMENU_MENUITEM(data));
+ GList * tmp = NULL;
- for (current_props = dbusmenu_menuitem_properties_list(DBUSMENU_MENUITEM(data));
- current_props != NULL && have_error == FALSE;
- current_props = g_list_next(current_props)) {
- dbusmenu_menuitem_property_remove(DBUSMENU_MENUITEM(data), (const gchar *)current_props->data);
+ for (tmp = current_props; tmp != NULL && have_error == FALSE; tmp = g_list_next(tmp)) {
+ dbusmenu_menuitem_property_remove(DBUSMENU_MENUITEM(data), (const gchar *)tmp->data);
}
g_list_free(current_props);