From: Timo Sirainen Date: Mon, 9 Mar 2015 17:29:04 +0000 (+0200) Subject: fs-posix: Don't try to unlink() the temp file twice after failure. X-Git-Tag: 2.2.16~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b82a8dd9afd7535607d22b8033892746bf80bee2;p=thirdparty%2Fdovecot%2Fcore.git fs-posix: Don't try to unlink() the temp file twice after failure. --- diff --git a/src/lib-fs/fs-posix.c b/src/lib-fs/fs-posix.c index 3270d551c3..dc7c7818a3 100644 --- a/src/lib-fs/fs-posix.c +++ b/src/lib-fs/fs-posix.c @@ -404,6 +404,8 @@ static int fs_posix_write_finish(struct posix_fs_file *file) fs_set_error(file->file.fs, "unlink(%s) failed: %m", file->temp_path); } + fs_posix_file_close(&file->file); + i_free_and_null(file->temp_path); if (ret < 0) return -1; break;