diff options
author | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-08-25 16:38:19 +0200 |
---|---|---|
committer | Lars Uebernickel <lars.uebernickel@canonical.com> | 2012-08-25 16:38:19 +0200 |
commit | ca5c4991f7815f9b5190b370bfa70c651facaf72 (patch) | |
tree | bc9fbde06ebc83d6130c28636e8f80dc740a5acc | |
parent | d79f11b267f7aebf3d306f7cf7a980a4070881a7 (diff) | |
download | ayatana-indicator-messages-ca5c4991f7815f9b5190b370bfa70c651facaf72.tar.gz ayatana-indicator-messages-ca5c4991f7815f9b5190b370bfa70c651facaf72.tar.bz2 ayatana-indicator-messages-ca5c4991f7815f9b5190b370bfa70c651facaf72.zip |
Plug memory leaks: return value of g_menu_model_get_item_link is transfer full
-rw-r--r-- | src/gmenuutils.c | 10 | ||||
-rw-r--r-- | src/messages-service.c | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/gmenuutils.c b/src/gmenuutils.c index f3ceba7..f63615b 100644 --- a/src/gmenuutils.c +++ b/src/gmenuutils.c @@ -40,7 +40,15 @@ g_menu_find_section (GMenu *menu, n_items = g_menu_model_get_n_items (model); for (i = 0; i < n_items; i++) { - if (section == g_menu_model_get_item_link (model, i, G_MENU_LINK_SECTION)) + GMenuModel *link; + gboolean found; + + link = g_menu_model_get_item_link (model, i, G_MENU_LINK_SECTION); + found = section == link; + + g_object_unref (link); + + if (found) return i; } diff --git a/src/messages-service.c b/src/messages-service.c index db7a8d7..31d2a5b 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -134,6 +134,8 @@ uses_chat_status_changed (GObject *object, if (show_chat) g_menu_insert_section (menu, 0, NULL, chat_section); } + + g_object_unref (first_section); } static AppSection * |