Skip to content

Commit

Permalink
Removed dead code to make static analyzer happier.
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen authored and GitLab committed Sep 13, 2016
1 parent 79fff45 commit 3177b41
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/lib-dcrypt/dcrypt-openssl.c
Expand Up @@ -1075,7 +1075,7 @@ bool dcrypt_openssl_load_private_key_dovecot_v2(struct dcrypt_private_key **key_
/* check that we have correct decryption key */
dcrypt_openssl_private_to_public_key(dec_key, &pubkey);
if (!dcrypt_openssl_public_key_id(pubkey, "sha256", data, error_r)) {
if (pubkey != NULL) dcrypt_openssl_unref_public_key(&pubkey);
dcrypt_openssl_unref_public_key(&pubkey);
return FALSE;
}

Expand Down
12 changes: 4 additions & 8 deletions src/lib-storage/index/dbox-common/dbox-save.c
Expand Up @@ -106,14 +106,10 @@ void dbox_save_end(struct dbox_save_context *ctx)
ctx->failed = TRUE;
}
if (mdata->output != dbox_output) {
if (mdata->output != NULL) {
/* e.g. zlib plugin had changed this */
o_stream_ref(dbox_output);
o_stream_destroy(&mdata->output);
mdata->output = dbox_output;
} else {
i_assert(ctx->failed);
}
/* e.g. zlib plugin had changed this */
o_stream_ref(dbox_output);
o_stream_destroy(&mdata->output);
mdata->output = dbox_output;
}
index_mail_cache_parse_deinit(ctx->ctx.dest_mail,
ctx->ctx.data.received_date,
Expand Down
8 changes: 2 additions & 6 deletions src/lib-storage/list/mailbox-list-iter.c
Expand Up @@ -164,21 +164,17 @@ mailbox_list_iter_init_multiple(struct mailbox_list *list,
enum mailbox_list_iter_flags flags)
{
struct mailbox_list_iterate_context *ctx;
int ret = 0;

i_assert(*patterns != NULL);

if ((flags & (MAILBOX_LIST_ITER_SELECT_SUBSCRIBED |
MAILBOX_LIST_ITER_RETURN_SUBSCRIBED)) != 0) {
ret = mailbox_list_iter_subscriptions_refresh(list);
if (ret < 0)
if (mailbox_list_iter_subscriptions_refresh(list) < 0)
return &mailbox_list_iter_failed;
}

ctx = list->v.iter_init(list, patterns, flags);
if (ret < 0)
ctx->failed = TRUE;
else if ((flags & MAILBOX_LIST_ITER_NO_AUTO_BOXES) == 0)
if ((flags & MAILBOX_LIST_ITER_NO_AUTO_BOXES) == 0)
mailbox_list_iter_init_autocreate(ctx);
return ctx;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib-storage/mail-storage.c
Expand Up @@ -1004,7 +1004,7 @@ int mailbox_verify_create_name(struct mailbox *box)
name++;
old_name = name;
}
if (old_name != NULL && strlen(old_name) > MAILBOX_MAX_HIERARCHY_NAME_LENGTH) {
if (strlen(old_name) > MAILBOX_MAX_HIERARCHY_NAME_LENGTH) {
mail_storage_set_error(box->storage, MAIL_ERROR_PARAMS,
"Mailbox name too long");
return -1;
Expand Down
4 changes: 4 additions & 0 deletions src/plugins/fts-squat/squat-trie.c
Expand Up @@ -2052,11 +2052,15 @@ squat_trie_lookup_real(struct squat_trie *trie, const char *str,
} else {
/* zero string length - list all root UIDs as definite
answers */
#if 0 /* FIXME: this code is never actually reached now. */
ret = squat_uidlist_get_seqrange(trie->uidlist,
trie->root.uid_list_idx,
&ctx.tmp_uids);
squat_trie_filter_type(type, &ctx.tmp_uids,
definite_uids);
#else
i_unreached();
#endif
}
seq_range_array_remove_seq_range(maybe_uids, definite_uids);
squat_trie_add_unknown(trie, maybe_uids);
Expand Down

0 comments on commit 3177b41

Please sign in to comment.