From: Marco Bettini Date: Tue, 10 Jun 2025 09:34:33 +0000 (+0000) Subject: lib-storage: mail_storage_create_list() - Remove moot tests for storage_class ==... X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=890fbb7314726f70dda5e7992e5de57338895aa0;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: mail_storage_create_list() - Remove moot tests for storage_class == NULL Found by coverity, 40008 Dereference before null check --- diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index 751e832502..03a1824d55 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -413,11 +413,9 @@ mail_storage_create_list(struct mail_namespace *ns, if (mail_set->mail_path[0] == '\0') { /* no root directory given. is this allowed? */ - if (storage_class == NULL && - (flags & MAIL_STORAGE_FLAG_NO_AUTODETECTION) == 0) { + if ((flags & MAIL_STORAGE_FLAG_NO_AUTODETECTION) == 0) { /* autodetection should take care of this */ - } else if (storage_class != NULL && - (storage_class->class_flags & MAIL_STORAGE_CLASS_FLAG_NO_ROOT) != 0) { + } else if ((storage_class->class_flags & MAIL_STORAGE_CLASS_FLAG_NO_ROOT) != 0) { /* root not required for this storage */ } else { *error_r = "Root mail directory not given";