summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Pandelea <alexandru.pandelea@gmail.com>2017-06-17 11:39:55 +0300
committerAlexandru Pandelea <alexandru.pandelea@gmail.com>2017-07-13 13:28:52 +0100
commit992c3d8c10beaf317354839bf30b662e872f182a (patch)
tree4681fe10e382252076ae098864fe9d314884796b
parent4fbeb923623435d4f5532175d9e5174491a9fef4 (diff)
downloadnautilus-992c3d8c10beaf317354839bf30b662e872f182a.tar.gz
file: fix invalid memory access
When the operation is freed on the first if, the operation will still be accessed on the second if. To fix this, merge the two if's since they both complete the operation. https://bugzilla.gnome.org/show_bug.cgi?id=783873
-rw-r--r--src/nautilus-file.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 55c44aa64..daa4009dd 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -2287,12 +2287,8 @@ batch_rename_get_info_callback (GObject *source_object,
op->renamed_files++;
- if (op->renamed_files + op->skipped_files == g_list_length (op->files))
- {
- nautilus_file_operation_complete (op, NULL, error);
- }
-
- if (op->files == NULL)
+ if (op->files == NULL ||
+ op->renamed_files + op->skipped_files == g_list_length (op->files))
{
nautilus_file_operation_complete (op, NULL, error);
}