]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fs: Fix logging old error when an unlogged error is replaced by new error
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 16 Oct 2020 08:20:04 +0000 (11:20 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 23 Oct 2020 08:32:15 +0000 (08:32 +0000)
The old error was logged as "(null)" if the error happened in a non-root
(filter) file.

src/lib-fs/fs-api.c

index 67be9e6468f80d69d003f967ffe52f4ec6ee8633..59e05a99c9141d780c37d58acd667fdb34083c72 100644 (file)
@@ -601,8 +601,8 @@ fs_set_verror(struct event *event, const char *fmt, va_list args)
 
        /* free old error after strdup in case args point to the old error */
        if (file != NULL) {
-               char *old_error = file->last_error;
                file = fs_file_get_error_file(file);
+               char *old_error = file->last_error;
 
                if (old_error != NULL && strcmp(old_error, new_error) == 0) {
                        /* identical error - ignore */