From 66fc9ffd4cdb6f4dff7bec3bcec7d27805d3220d Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 15 Sep 2019 00:06:58 +0300 Subject: [PATCH] lib: istream-seekable - Don't double-close temp file fd on errors Closing the fd_input stream already auto-closes the fd. --- src/lib/istream-seekable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/istream-seekable.c b/src/lib/istream-seekable.c index ef7f2c09a1..d1879fe81d 100644 --- a/src/lib/istream-seekable.c +++ b/src/lib/istream-seekable.c @@ -125,7 +125,7 @@ static int copy_to_temp_file(struct seekable_istream *sstream) i_stream_get_name(&stream->istream), i_stream_get_error(sstream->fd_input)); i_stream_destroy(&sstream->fd_input); - i_close_fd(&sstream->fd); + sstream->fd = -1; /* autoclosed by fd_input */ return -1; } } @@ -258,7 +258,7 @@ static int i_stream_seekable_write_failed(struct seekable_istream *sstream) return -1; } i_stream_destroy(&sstream->fd_input); - i_close_fd(&sstream->fd); + sstream->fd = -1; /* autoclosed by fd_input */ i_free_and_null(sstream->temp_path); return 0; -- 2.47.3