dovecot-2.2: Removed pointless NULL checks.

dovecot at dovecot.org dovecot at dovecot.org
Thu Jun 12 23:20:41 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/203b3a6f508f
changeset: 17464:203b3a6f508f
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jun 13 00:45:43 2014 +0300
description:
Removed pointless NULL checks.
Found by Coverity

diffstat:

 src/director/director.c                  |  3 +--
 src/doveadm/dsync/dsync-mailbox-import.c |  3 +--
 src/lib-index/mail-index.c               |  3 +--
 src/plugins/acl/doveadm-acl.c            |  2 +-
 4 files changed, 4 insertions(+), 7 deletions(-)

diffs (51 lines):

diff -r 9b1734587b28 -r 203b3a6f508f src/director/director.c
--- a/src/director/director.c	Fri Jun 13 00:30:27 2014 +0300
+++ b/src/director/director.c	Fri Jun 13 00:45:43 2014 +0300
@@ -322,8 +322,7 @@
 	   if they are, we want to know it fast. */
 	if (dir->left != NULL)
 		director_connection_ping(dir->left);
-	if (dir->right != NULL)
-		director_connection_ping(dir->right);
+	director_connection_ping(dir->right);
 }
 
 bool director_resend_sync(struct director *dir)
diff -r 9b1734587b28 -r 203b3a6f508f src/doveadm/dsync/dsync-mailbox-import.c
--- a/src/doveadm/dsync/dsync-mailbox-import.c	Fri Jun 13 00:30:27 2014 +0300
+++ b/src/doveadm/dsync/dsync-mailbox-import.c	Fri Jun 13 00:45:43 2014 +0300
@@ -530,8 +530,7 @@
 		}
 		importer->cur_uid_has_change = FALSE;
 	}
-	importer->cur_uid_has_change = importer->cur_mail != NULL &&
-		importer->cur_mail->uid == wanted_uid;
+	importer->cur_uid_has_change = importer->cur_mail->uid == wanted_uid;
 	if (importer->mails_have_guids) {
 		if (mail_get_special(importer->cur_mail, MAIL_FETCH_GUID,
 				     &importer->cur_guid) < 0) {
diff -r 9b1734587b28 -r 203b3a6f508f src/lib-index/mail-index.c
--- a/src/lib-index/mail-index.c	Fri Jun 13 00:30:27 2014 +0300
+++ b/src/lib-index/mail-index.c	Fri Jun 13 00:45:43 2014 +0300
@@ -541,8 +541,7 @@
 	if ((index->map->hdr.flags & MAIL_INDEX_HDR_FLAG_CORRUPTED) != 0) {
 		/* index was marked corrupted. we'll probably need to
 		   recreate the files. */
-		if (index->map != NULL)
-			mail_index_unmap(&index->map);
+		mail_index_unmap(&index->map);
 		mail_index_close_file(index);
 		mail_transaction_log_close(index->log);
 		if ((ret = mail_index_open_files(index, flags)) <= 0)
diff -r 9b1734587b28 -r 203b3a6f508f src/plugins/acl/doveadm-acl.c
--- a/src/plugins/acl/doveadm-acl.c	Fri Jun 13 00:30:27 2014 +0300
+++ b/src/plugins/acl/doveadm-acl.c	Fri Jun 13 00:45:43 2014 +0300
@@ -426,7 +426,7 @@
 				     &rights) < 0)
 		i_fatal("Failed to get rights");
 
-	if (rights == NULL || rights[0] == NULL)
+	if (rights[0] == NULL)
 		i_info("User %s has no rights for mailbox", ns->user->username);
 	else {
 		i_info("User %s has rights: %s",


More information about the dovecot-cvs mailing list