summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2020-01-23 11:38:14 +0100
committerOndrej Holy <oholy@redhat.com>2020-01-24 06:43:27 +0000
commit7194ad7cb0257bfcdf7383e3bf42f34a218061a4 (patch)
tree48cfac1d07d92b69cd8e57a900fcf5e91bc57de6
parent130def8c1205a00444789c7784b3874827ef278f (diff)
downloadnautilus-7194ad7cb0257bfcdf7383e3bf42f34a218061a4.tar.gz
operations-ui-manager: Fix crash after a conflict dialog response
After a conflict dialog response, Nautilus accesses an already released structure, which causes crashes for some people. Let's store pointer before releasing the structure in order to prevent the invalid reads. Fixes: https://gitlab.gnome.org/GNOME/nautilus/issues/1353
-rw-r--r--src/nautilus-operations-ui-manager.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nautilus-operations-ui-manager.c b/src/nautilus-operations-ui-manager.c
index fbaac05c9..43dbaf053 100644
--- a/src/nautilus-operations-ui-manager.c
+++ b/src/nautilus-operations-ui-manager.c
@@ -486,6 +486,7 @@ copy_move_conflict_ask_user_action (GtkWindow *parent_window,
GFile *destination_directory_name)
{
FileConflictDialogData *data;
+ FileConflictResponse *response;
data = g_slice_new0 (FileConflictDialogData);
data->parent = parent_window;
@@ -502,9 +503,10 @@ copy_move_conflict_ask_user_action (GtkWindow *parent_window,
run_file_conflict_dialog,
data);
+ response = g_steal_pointer (&data->response);
g_slice_free (FileConflictDialogData, data);
- return data->response;
+ return response;
}
typedef struct