From: Timo Sirainen Date: Fri, 8 Nov 2013 15:44:25 +0000 (+0200) Subject: lib-fs: Don't crash if istream-fs-file is closed without never being read. X-Git-Tag: 2.2.8~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e52982751bb55475d25bd1e6b6b69f4add3d58ec;p=thirdparty%2Fdovecot%2Fcore.git lib-fs: Don't crash if istream-fs-file is closed without never being read. --- diff --git a/src/lib-fs/istream-fs-file.c b/src/lib-fs/istream-fs-file.c index 0b94c8a180..23351a0387 100644 --- a/src/lib-fs/istream-fs-file.c +++ b/src/lib-fs/istream-fs-file.c @@ -15,7 +15,8 @@ static void i_stream_fs_file_close(struct iostream_private *stream, { struct fs_file_istream *fstream = (struct fs_file_istream *)stream; - i_stream_destroy(&fstream->istream.parent); + if (fstream->istream.parent != NULL) + i_stream_destroy(&fstream->istream.parent); fs_file_deinit(&fstream->file); }