From: Timo Sirainen Date: Sat, 14 Sep 2019 21:06:58 +0000 (+0300) Subject: lib: istream-seekable - Don't double-close temp file fd on errors X-Git-Tag: 2.3.18~221 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66fc9ffd4cdb6f4dff7bec3bcec7d27805d3220d;p=thirdparty%2Fdovecot%2Fcore.git lib: istream-seekable - Don't double-close temp file fd on errors Closing the fd_input stream already auto-closes the fd. --- 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;