diff --git a/gio/glocalfile.c b/gio/glocalfile.c index 824f624c4..a6fea94a2 100644 --- a/gio/glocalfile.c +++ b/gio/glocalfile.c @@ -2276,9 +2276,18 @@ g_local_file_trash (GFile *file, original_name_escaped, delete_time); g_free (delete_time); - g_file_set_contents_full (infofile, data, -1, + if (!g_file_set_contents_full (infofile, data, -1, G_FILE_SET_CONTENTS_CONSISTENT | G_FILE_SET_CONTENTS_ONLY_EXISTING, - 0600, NULL); + 0600, error)) + { + g_unlink (infofile); + + g_free (filesdir); + g_free (trashname); + g_free (infofile); + + return FALSE; + } /* TODO: Maybe we should verify that you can delete the file from the trash * before moving it? OTOH, that is hard, as it needs a recursive scan