]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-var-expand: Do not clobber error in var_expand_parser_error()
authorAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 15 Dec 2025 10:25:21 +0000 (12:25 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Mon, 15 Dec 2025 10:26:26 +0000 (12:26 +0200)
src/lib-var-expand/var-expand-lexer.l

index 29e884ed9b1bed1babb51e9a3e940797b421308e..4465589b7b26e3bc3e0c31613fe7f95d6e853b9d 100644 (file)
@@ -132,7 +132,8 @@ extern void var_expand_parser_error(YYLTYPE *loc, YYSTYPE *state, const char *er
 void var_expand_parser_error(YYLTYPE *loc ATTR_UNUSED, YYSTYPE *state, const char *error)
 {
        state->failed = TRUE;
-       state->error = p_strdup(state->pool, error);
+       if (state->error == NULL)
+               state->error = p_strdup(state->pool, error);
 }
 
 static int scanner_error(void *scanner, const char *msg)