]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: istream-seekable - Fix fd leak if initial temp file couldn't be read back
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 26 Oct 2017 14:10:57 +0000 (17:10 +0300)
committerTimo Sirainen <tss@dovecot.fi>
Wed, 1 Nov 2017 11:45:51 +0000 (13:45 +0200)
That should normally never happen.

src/lib/istream-seekable.c

index ccdd33a5cb426002a55cff67d6e7aa2aa5769396..1fd14c72b85496ed6d0ab7b27735c6070c2382bf 100644 (file)
@@ -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;
                }
        }