diff options
author | Ernestas Kulik <ernestask@src.gnome.org> | 2016-11-12 22:45:55 +0200 |
---|---|---|
committer | Ernestas Kulik <ernestask@src.gnome.org> | 2016-11-23 22:10:52 +0200 |
commit | 12476f47ecf012a80734e5d9aa4f7f17ab81b3bd (patch) | |
tree | ab11c5fbfb45c957a99e09d540b2b54d6616836a | |
parent | 2dc2983789b97c8faaf69db3a220a5d96ca82e9d (diff) | |
download | nautilus-12476f47ecf012a80734e5d9aa4f7f17ab81b3bd.tar.gz |
clipboard: free item list
The item list in nautilus_clipboard_is_cut_from_selection_data () is
never freed.
https://bugzilla.gnome.org/show_bug.cgi?id=774232
-rw-r--r-- | src/nautilus-clipboard.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/nautilus-clipboard.c b/src/nautilus-clipboard.c index 957e11b12..808ac1b8f 100644 --- a/src/nautilus-clipboard.c +++ b/src/nautilus-clipboard.c @@ -213,21 +213,15 @@ gboolean nautilus_clipboard_is_cut_from_selection_data (GtkSelectionData *selection_data) { GList *items; + gboolean is_cut_from_selection_data; items = get_item_list_from_selection_data (selection_data); - if (items == NULL) - { - return FALSE; - } + is_cut_from_selection_data = items != NULL && + g_strcmp0 ((gchar *)items->data, "cut") == 0; - if (strcmp ((gchar *) items->data, "cut") == 0) - { - return TRUE; - } - else - { - return FALSE; - } + g_list_free_full (items, g_free); + + return is_cut_from_selection_data; } static void |