diff options
author | Ondrej Holy <oholy@redhat.com> | 2020-01-23 10:38:14 +0000 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2020-01-24 06:51:51 +0000 |
commit | 52389750751e948621558f7d0c075ab406d01978 (patch) | |
tree | 9e5d626b72662c8b7d922769068cd99b80cd1eb5 | |
parent | 4addfaa8f69a16483433be5a65306e5000010790 (diff) | |
download | nautilus-52389750751e948621558f7d0c075ab406d01978.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
(cherry picked from commit 7194ad7cb0257bfcdf7383e3bf42f34a218061a4)
-rw-r--r-- | src/nautilus-operations-ui-manager.c | 4 |
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 |