dovecot-2.2: Make static analyzer happier.

dovecot at dovecot.org dovecot at dovecot.org
Sun Jun 24 20:58:15 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/f07ba5e7d97d
changeset: 14675:f07ba5e7d97d
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jun 24 20:58:04 2012 +0300
description:
Make static analyzer happier.

diffstat:

 src/doveadm/dsync/dsync-mailbox-import.c  |  4 ++++
 src/lib-index/mail-transaction-log-view.c |  2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)

diffs (40 lines):

diff -r efd276ab2577 -r f07ba5e7d97d src/doveadm/dsync/dsync-mailbox-import.c
--- a/src/doveadm/dsync/dsync-mailbox-import.c	Sun Jun 24 20:57:06 2012 +0300
+++ b/src/doveadm/dsync/dsync-mailbox-import.c	Sun Jun 24 20:58:04 2012 +0300
@@ -331,6 +331,7 @@
 	diff = importer_mail_cmp(&m1, &m2);
 	if (diff < 0) {
 		/* add a record for local mail */
+		i_assert(importer->cur_mail != NULL);
 		newmail->guid = p_strdup(importer->pool, importer->cur_guid);
 		newmail->uid = importer->cur_mail->uid;
 		newmail->uid_in_local = TRUE;
@@ -338,6 +339,7 @@
 			newmail->uid >= importer->remote_uid_next;
 		remote_saved = FALSE;
 	} else if (diff > 0) {
+		i_assert(save_change != NULL);
 		newmail->guid = save_change->guid;
 		newmail->uid = save_change->uid;
 		newmail->uid_in_local = FALSE;
@@ -346,6 +348,8 @@
 		remote_saved = TRUE;
 	} else {
 		/* identical */
+		i_assert(importer->cur_mail != NULL);
+		i_assert(save_change != NULL);
 		newmail->guid = save_change->guid;
 		newmail->uid = importer->cur_mail->uid;
 		newmail->uid_in_local = TRUE;
diff -r efd276ab2577 -r f07ba5e7d97d src/lib-index/mail-transaction-log-view.c
--- a/src/lib-index/mail-transaction-log-view.c	Sun Jun 24 20:57:06 2012 +0300
+++ b/src/lib-index/mail-transaction-log-view.c	Sun Jun 24 20:58:04 2012 +0300
@@ -284,6 +284,8 @@
 {
 	struct mail_transaction_log_file *file, *first = view->log->files;
 
+	i_assert(first != NULL);
+
 	/* make sure .log.2 file is opened */
 	(void)mail_transaction_log_find_file(view->log, 1, FALSE, &file);
 


More information about the dovecot-cvs mailing list