]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Make static analyzer happier.
authorTimo Sirainen <tss@iki.fi>
Fri, 5 Apr 2013 12:17:30 +0000 (15:17 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 5 Apr 2013 12:17:30 +0000 (15:17 +0300)
src/doveadm/dsync/doveadm-dsync.c
src/doveadm/dsync/dsync-mailbox-export.c
src/doveadm/dsync/dsync-mailbox-import.c
src/lib-http/http-client-request.c
src/lib/test-json-parser.c

index 8738306b930852f4e9542bd112899924abf351e1..28421b5a6b54da5de0c1ef89aa141d3dfa0d4fe2 100644 (file)
@@ -450,7 +450,7 @@ cmd_dsync_run(struct doveadm_mail_cmd_context *_ctx, struct mail_user *user)
        struct mail_namespace *sync_ns = NULL;
        enum dsync_brain_flags brain_flags;
        bool remote_errors_logged = FALSE;
-       int status, ret = 0;
+       int status = 0, ret = 0;
 
        user->admin = TRUE;
        user->dsyncing = TRUE;
index 0e8b3cf6a903099b3e71ee0d42dc853dd2889c14..596e6f88871016bf390e474ffdd0bf7d952c0fe4 100644 (file)
@@ -481,13 +481,11 @@ dsync_mailbox_export_init(struct mailbox *box,
 static int
 dsync_mailbox_export_iter_next_nonexistent_attr(struct dsync_mailbox_exporter *exporter)
 {
-       HASH_TABLE_TYPE(dsync_attr_change) attr_changes;
        struct dsync_mailbox_attribute *attr;
        struct mail_attribute_value value;
 
-       attr_changes = dsync_transaction_log_scan_get_attr_hash(exporter->log_scan);
-
-       while (hash_table_iterate(exporter->attr_change_iter, attr_changes,
+       while (hash_table_iterate(exporter->attr_change_iter,
+                                 dsync_transaction_log_scan_get_attr_hash(exporter->log_scan),
                                  &attr, &attr)) {
                if (attr->exported || !attr->deleted)
                        continue;
index 7d321f172303572c82a2ca24daa8d03495f29042..92442c1c5ea422a6683231a3e2a58ca02663a637 100644 (file)
@@ -1656,6 +1656,8 @@ dsync_mailbox_import_handle_mail(struct dsync_mailbox_importer *importer,
        const char *request_guid = NULL;
        uint32_t request_uid = 0;
 
+       i_assert(all_newmails != NULL);
+
        /* get the list of the current local UIDs and the wanted UIDs.
           find the first remote instance that we can request in case there are
           no local instances */
index ffc2e93bd161cc0222da501b91101cd107985106..8e9392d4954fab323ed29e4266228b3bcc3d7138 100644 (file)
@@ -218,6 +218,8 @@ void http_client_request_submit(struct http_client_request *req)
 static void
 http_client_request_finish_payload_out(struct http_client_request *req)
 {
+       i_assert(req->conn != NULL);
+
        if (req->payload_output != NULL) {
                o_stream_unref(&req->payload_output);
                req->payload_output = NULL;
index 5bb0b0c0ad3d63b7d407e9389ca02db406418341..4947d7fa62118728ccda8f62be51aa569e2ae35c 100644 (file)
@@ -128,6 +128,7 @@ static void test_json_parser_success(bool full_size)
                test_istream_set_size(input, i);
 
                for (;;) {
+                       value = NULL;
                        if (pos < N_ELEMENTS(json_output) &&
                            json_output[pos].type == (enum json_type)TYPE_SKIP) {
                                json_parse_skip_next(parser);