aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel d'Andrada <daniel.dandrada@canonical.com>2012-02-09 15:09:50 -0200
committerDaniel d'Andrada <daniel.dandrada@canonical.com>2012-02-09 15:09:50 -0200
commit484c86d10f4295fd13248bafdf0862bc51c51b5b (patch)
tree1fad0a2a5c739e27e820640fdb78e379b32414f6
parent817be57dddbcc9e9b8935bb65e95b91dd6ca03f0 (diff)
downloadayatana-indicator-messages-484c86d10f4295fd13248bafdf0862bc51c51b5b.tar.gz
ayatana-indicator-messages-484c86d10f4295fd13248bafdf0862bc51c51b5b.tar.bz2
ayatana-indicator-messages-484c86d10f4295fd13248bafdf0862bc51c51b5b.zip
Plug leak in launcher_menu_item_new
Memory returned by indicator_desktop_shortcuts_nick_get_name has to be freed.
-rw-r--r--src/launcher-menu-item.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/launcher-menu-item.c b/src/launcher-menu-item.c
index e01806e..91cbbb8 100644
--- a/src/launcher-menu-item.c
+++ b/src/launcher-menu-item.c
@@ -211,7 +211,10 @@ launcher_menu_item_new (const gchar * desktop_file)
dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_TYPE, APPLICATION_MENUITEM_TYPE);
g_object_set_data(G_OBJECT(mi), NICK_DATA, (gpointer)nicks[i]);
- dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, indicator_desktop_shortcuts_nick_get_name(priv->ids, nicks[i]));
+ gchar *name = indicator_desktop_shortcuts_nick_get_name(priv->ids, nicks[i]);
+ dbusmenu_menuitem_property_set(mi, DBUSMENU_MENUITEM_PROP_LABEL, name);
+ g_free(name);
+
g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(nick_activate_cb), self);
priv->shortcuts = g_list_append(priv->shortcuts, mi);