]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-settings: If we already found out setting doesn't exist, don't try to parse it
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sun, 28 May 2023 20:09:10 +0000 (23:09 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:08 +0000 (12:34 +0200)
src/lib-settings/settings.c

index c6f9103c452bf5da3d0ea12eaf2bf4b57c841987..4f04a303c2cc46d06e578655d43a2b2927621a96 100644 (file)
@@ -911,7 +911,9 @@ settings_override_get_value(struct setting_parser_context *parser,
                key = t_strconcat("plugin/", key, NULL);
                old_value = settings_parse_get_value(parser, &key, &value_type);
        }
-       if (!set->append || old_value == NULL) {
+       if (old_value == NULL)
+               return 0;
+       if (!set->append) {
                *_key = key;
                *value_r = set->value;
                return 1;
@@ -963,8 +965,10 @@ settings_instance_override(struct settings_apply_ctx *ctx,
                                                      &key, &value, error_r);
                if (ret < 0)
                        return -1;
-               if (ret == 0)
+               if (ret == 0) {
+                       /* setting doesn't exist in this info */
                        continue;
+               }
 
                if (value != set->value)
                        value = p_strdup(&ctx->mpool->pool, value);