From: Timo Sirainen Date: Sun, 16 Jun 2013 21:03:16 +0000 (+0300) Subject: Make static analyzer happier. X-Git-Tag: 2.2.4~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d229d26d263a57a77eec8fe7cba24fbfd9509966;p=thirdparty%2Fdovecot%2Fcore.git Make static analyzer happier. --- diff --git a/src/doveadm/dsync/doveadm-dsync.c b/src/doveadm/dsync/doveadm-dsync.c index b8196e0063..605438b929 100644 --- a/src/doveadm/dsync/doveadm-dsync.c +++ b/src/doveadm/dsync/doveadm-dsync.c @@ -299,6 +299,9 @@ static bool paths_are_equal(struct mail_user *user1, struct mail_user *user2, { const char *path1, *path2; + i_assert(user1->namespaces != NULL); + i_assert(user2->namespaces != NULL); + return mailbox_list_get_root_path(user1->namespaces->list, type, &path1) && mailbox_list_get_root_path(user2->namespaces->list, type, &path2) && strcmp(path1, path2) == 0; diff --git a/src/doveadm/dsync/test-dsync-mailbox-tree-sync.c b/src/doveadm/dsync/test-dsync-mailbox-tree-sync.c index 3d8b909084..e0fc7bf893 100644 --- a/src/doveadm/dsync/test-dsync-mailbox-tree-sync.c +++ b/src/doveadm/dsync/test-dsync-mailbox-tree-sync.c @@ -624,7 +624,8 @@ static void test_dsync_mailbox_tree_sync_renames20(void) node_create(tree2, 3, "1/0/2", 0); test_trees_nofree(tree1, &tree2); - test_assert(tree1->root.first_child->next == NULL); + test_assert(tree1->root.first_child != NULL && + tree1->root.first_child->next == NULL); dsync_mailbox_tree_deinit(&tree1); test_end(); } diff --git a/src/imap-login/imap-proxy.c b/src/imap-login/imap-proxy.c index e283d48a1f..e7faebc5db 100644 --- a/src/imap-login/imap-proxy.c +++ b/src/imap-login/imap-proxy.c @@ -234,6 +234,7 @@ int imap_proxy_parse_line(struct client *client, const char *line) client_proxy_failed(client, TRUE); return -1; } + i_assert(ret == 0); str_truncate(str, 0); base64_encode(data, data_len, str); diff --git a/src/pop3-login/pop3-proxy.c b/src/pop3-login/pop3-proxy.c index dd5c7dc966..b2daa4719d 100644 --- a/src/pop3-login/pop3-proxy.c +++ b/src/pop3-login/pop3-proxy.c @@ -110,6 +110,7 @@ pop3_proxy_continue_sasl_auth(struct client *client, struct ostream *output, error)); return -1; } + i_assert(ret == 0); str_truncate(str, 0); base64_encode(data, data_len, str);