diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2013-11-19 13:00:59 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2013-11-19 13:00:59 +0000 |
commit | 0ebdbd89a221f0d0ca706478084f2ff498317a3c (patch) | |
tree | 576882f71f532353a9cb0e8cc575ae0d14dce71a /src/im-menu.c | |
parent | 5c15b8149f6270edcf443884717535ad236001dd (diff) | |
parent | 6fbc5160dff89422e1fe4aef1dc60b8d09ffb579 (diff) | |
download | ayatana-indicator-messages-0ebdbd89a221f0d0ca706478084f2ff498317a3c.tar.gz ayatana-indicator-messages-0ebdbd89a221f0d0ca706478084f2ff498317a3c.tar.bz2 ayatana-indicator-messages-0ebdbd89a221f0d0ca706478084f2ff498317a3c.zip |
im-menu: fix leak.
Approved by Charles Kerr, PS Jenkins bot, Ted Gould.
Diffstat (limited to 'src/im-menu.c')
-rw-r--r-- | src/im-menu.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/im-menu.c b/src/im-menu.c index 1aaffe3..55ea99c 100644 --- a/src/im-menu.c +++ b/src/im-menu.c @@ -179,11 +179,17 @@ im_menu_insert_section (ImMenu *menu, for (position = 1; position < g_menu_model_get_n_items(G_MENU_MODEL (priv->menu)) - 1; position++) { - gchar * item_sort = NULL; + gchar *item_sort; + if (g_menu_model_get_item_attribute(G_MENU_MODEL(priv->menu), position, "x-messaging-menu-sort-string", "s", &item_sort)) - if (g_utf8_collate(sort_string, item_sort) < 0) - break; - g_free(item_sort); + { + gint cmp; + + cmp = g_utf8_collate(sort_string, item_sort); + g_free (item_sort); + if (cmp < 0) + break; + } } item = g_menu_item_new_section (NULL, section); |