From: Timo Sirainen Date: Mon, 7 Sep 2015 21:46:11 +0000 (+0300) Subject: Make static analyzer happier. X-Git-Tag: 2.2.19.rc1~73 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=25f959d63f5379702f44f5ae125eb3b70a6a47d7;p=thirdparty%2Fdovecot%2Fcore.git Make static analyzer happier. --- diff --git a/src/config/config-request.c b/src/config/config-request.c index 3a7170fad4..32d9a74322 100644 --- a/src/config/config-request.c +++ b/src/config/config-request.c @@ -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); diff --git a/src/lib-storage/mail-search-args-simplify.c b/src/lib-storage/mail-search-args-simplify.c index 441ec7f42b..336201d0a0 100644 --- a/src/lib-storage/mail-search-args-simplify.c +++ b/src/lib-storage/mail-search-args-simplify.c @@ -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;