]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fs-posix: Don't try to unlink() the temp file twice after failure.
authorTimo Sirainen <tss@iki.fi>
Mon, 9 Mar 2015 17:29:04 +0000 (19:29 +0200)
committerTimo Sirainen <tss@iki.fi>
Mon, 9 Mar 2015 17:29:04 +0000 (19:29 +0200)
src/lib-fs/fs-posix.c

index 3270d551c386ffcbe2014d8f8169428a092c37dd..dc7c7818a30d13f80ecbff189753f49f5bb0ac2d 100644 (file)
@@ -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;