From: Timo Sirainen Date: Thu, 26 Oct 2017 14:10:57 +0000 (+0300) Subject: lib: istream-seekable - Fix fd leak if initial temp file couldn't be read back X-Git-Tag: 2.3.0.rc1~646 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fe5eaeb32a8bbc31ce0673793b1c37f72d00d47;p=thirdparty%2Fdovecot%2Fcore.git lib: istream-seekable - Fix fd leak if initial temp file couldn't be read back That should normally never happen. --- diff --git a/src/lib/istream-seekable.c b/src/lib/istream-seekable.c index ccdd33a5cb..1fd14c72b8 100644 --- a/src/lib/istream-seekable.c +++ b/src/lib/istream-seekable.c @@ -122,6 +122,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); return -1; } }