]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Make static analyzer happier.
authorTimo Sirainen <tss@iki.fi>
Mon, 7 Sep 2015 21:46:11 +0000 (00:46 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 7 Sep 2015 21:46:11 +0000 (00:46 +0300)
src/config/config-request.c
src/lib-storage/mail-search-args-simplify.c

index 3a7170fad40be8657cb33121ada64217e1f50690..32d9a7432283e543dcd2053eaaa99eb9c0076acd 100644 (file)
@@ -206,7 +206,7 @@ settings_export(struct config_export_context *ctx,
 {
        const struct setting_define *def;
        const void *value, *default_value, *change_value;
-       void *const *children = NULL, *const *change_children = NULL;
+       void *const *children, *const *change_children = NULL;
        unsigned int i, count, count2, prefix_len;
        const char *str;
        char *key;
@@ -244,7 +244,7 @@ settings_export(struct config_export_context *ctx,
                }
 
                dump = FALSE;
-               count = 0;
+               count = 0; children = NULL;
                str_truncate(ctx->value, 0);
                switch (def->type) {
                case SET_BOOL:
@@ -333,6 +333,7 @@ settings_export(struct config_export_context *ctx,
                        }
                }
 
+               i_assert(count == 0 || children != NULL);
                prefix_len = str_len(ctx->prefix);
                for (i = 0; i < count; i++) {
                        str_append(ctx->prefix, def->key);
index 441ec7f42b3e3a525feaaff62211a8f8e45764b1..336201d0a0b0b0f3dde19a6aaa1d8e3a5652c4e6 100644 (file)
@@ -346,6 +346,7 @@ mail_search_args_simplify_sub(struct mailbox *box,
                        break;
                }
                if (merged) {
+                       i_assert(prev_arg != NULL);
                        prev_arg->next = args->next;
                        args = args->next;
                        ctx.removals = TRUE;