From: Timo Sirainen Date: Fri, 16 Oct 2020 08:21:51 +0000 (+0300) Subject: lib-fs: Add assert to make sure we never log "(null)" as the old error X-Git-Tag: 2.3.13~69 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=966140ac533cc758f6c063f9d177b7c593f20815;p=thirdparty%2Fdovecot%2Fcore.git lib-fs: Add assert to make sure we never log "(null)" as the old error --- diff --git a/src/lib-fs/fs-api.c b/src/lib-fs/fs-api.c index 59e05a99c9..12bce8a686 100644 --- a/src/lib-fs/fs-api.c +++ b/src/lib-fs/fs-api.c @@ -604,7 +604,9 @@ fs_set_verror(struct event *event, const char *fmt, va_list args) file = fs_file_get_error_file(file); char *old_error = file->last_error; - if (old_error != NULL && strcmp(old_error, new_error) == 0) { + if (old_error == NULL) { + i_assert(!file->last_error_changed); + } else if (strcmp(old_error, new_error) == 0) { /* identical error - ignore */ } else if (file->last_error_changed) { /* multiple fs_set_error() calls used without