summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Pandelea <alexandru.pandelea@gmail.com>2017-06-17 11:39:55 +0300
committerErnestas Kulik <ernestask@gnome.org>2017-06-24 20:25:07 +0300
commit68cfc994f9da5dab723f5cdd2daecc893c342f40 (patch)
treebb4c8f506ddc0dcc9c2fc8034939bc1230dd68d4
parent0119b67cfa3eeadb870c728f46667601e9dd7553 (diff)
downloadnautilus-68cfc994f9da5dab723f5cdd2daecc893c342f40.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);
}