From 95b78380cb866f7597ad467f99220aacf0cadc4a Mon Sep 17 00:00:00 2001 From: Alexander Schwinn <acs82@gmx.de> Date: Sun, 18 Feb 2018 20:42:43 +0100 Subject: [PATCH] Fixed an uncritical "use after free" ( check if NULL after free ) Afaik it did not cause trouble so far. --- thunar/thunar-standard-view.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c index c94c38d2e..2bddff8d2 100644 --- a/thunar/thunar-standard-view.c +++ b/thunar/thunar-standard-view.c @@ -4257,7 +4257,6 @@ thunar_standard_view_context_menu (ThunarStandardView *standard_view) /* merge the custom menu actions for the selected items */ selected_items = (*THUNAR_STANDARD_VIEW_GET_CLASS (standard_view)->get_selected_items) (standard_view); thunar_standard_view_merge_custom_actions (standard_view, selected_items); - g_list_free_full (selected_items, (GDestroyNotify) gtk_tree_path_free); /* grab an additional reference on the view */ g_object_ref (G_OBJECT (standard_view)); @@ -4266,6 +4265,8 @@ thunar_standard_view_context_menu (ThunarStandardView *standard_view) menu = gtk_ui_manager_get_widget (standard_view->ui_manager, (selected_items != NULL) ? "/file-context-menu" : "/folder-context-menu"); thunar_gtk_menu_run (GTK_MENU (menu)); + g_list_free_full (selected_items, (GDestroyNotify) gtk_tree_path_free); + /* release the additional reference on the view */ g_object_unref (G_OBJECT (standard_view)); } -- GitLab