From: Timo Sirainen Date: Wed, 1 Jun 2016 14:11:53 +0000 (+0300) Subject: lib-fs: Added more asserts X-Git-Tag: 2.3.0.rc1~3598 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98ff8998f6ddd019d22db541cdb316df2c37f15d;p=thirdparty%2Fdovecot%2Fcore.git lib-fs: Added more asserts --- diff --git a/src/lib-fs/fs-api.c b/src/lib-fs/fs-api.c index 97551be7ea..94b87339ff 100644 --- a/src/lib-fs/fs-api.c +++ b/src/lib-fs/fs-api.c @@ -666,8 +666,10 @@ static int fs_write_stream_finish_int(struct fs_file *file, bool success) indicated a failure. */ i_assert(success); } - if (ret != 0) + if (ret != 0) { + i_assert(file->output == NULL); file->writing_stream = FALSE; + } return ret; } @@ -676,6 +678,7 @@ int fs_write_stream_finish(struct fs_file *file, struct ostream **output) bool success = TRUE; i_assert(*output == file->output || *output == NULL); + i_assert(output != &file->output); *output = NULL; if (file->output != NULL) {