diff options
author | Ted Gould <ted@gould.cx> | 2011-03-10 09:18:26 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-03-10 09:18:26 -0600 |
commit | 065d12b5d53dbd081a4c262da6dd4b7ea2188ae2 (patch) | |
tree | 878c02659ae6060788a5a2d38e7fe558357bebf5 /libdbusmenu-glib | |
parent | da12001cce940316c26b8dc68da507f62ea689a7 (diff) | |
parent | ec307704b44db4f65f3534f23cfdf517c883a9e1 (diff) | |
download | libdbusmenu-065d12b5d53dbd081a4c262da6dd4b7ea2188ae2.tar.gz libdbusmenu-065d12b5d53dbd081a4c262da6dd4b7ea2188ae2.tar.bz2 libdbusmenu-065d12b5d53dbd081a4c262da6dd4b7ea2188ae2.zip |
Memory leak fixes
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/client.c | 11 |
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); |