]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fs: Add assert to make sure we never log "(null)" as the old error
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 16 Oct 2020 08:21:51 +0000 (11:21 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 23 Oct 2020 08:32:15 +0000 (08:32 +0000)
src/lib-fs/fs-api.c

index 59e05a99c9141d780c37d58acd667fdb34083c72..12bce8a686799e70ca4368ee63807f946d7e1b7d 100644 (file)
@@ -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