Skip to content

Commit

Permalink
lib-lda: Require context in mail-deliver
Browse files Browse the repository at this point in the history
Satisfies static analyzers
  • Loading branch information
cmouse authored and mrannanj committed Feb 20, 2018
1 parent bf055b4 commit 04bdefa
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/lib-lda/mail-deliver.c
Expand Up @@ -20,9 +20,9 @@
#define DUPLICATE_DB_NAME "lda-dupes"

#define MAIL_DELIVER_USER_CONTEXT(obj) \
MODULE_CONTEXT(obj, mail_deliver_user_module)
MODULE_CONTEXT_REQUIRE(obj, mail_deliver_user_module)
#define MAIL_DELIVER_STORAGE_CONTEXT(obj) \
MODULE_CONTEXT(obj, mail_deliver_storage_module)
MODULE_CONTEXT_REQUIRE(obj, mail_deliver_storage_module)

struct mail_deliver_user {
union mail_user_module_context module_ctx;
Expand Down Expand Up @@ -598,7 +598,6 @@ mail_deliver_transaction_begin(struct mailbox *box,
struct mailbox_transaction_context *t;
struct mail_deliver_transaction *dt;

i_assert(muser != NULL);
i_assert(muser->deliver_ctx != NULL);

t = mbox->module_ctx.super.transaction_begin(box, flags, reason);
Expand All @@ -618,8 +617,6 @@ mail_deliver_transaction_commit(struct mailbox_transaction_context *ctx,
struct mail_deliver_user *muser =
MAIL_DELIVER_USER_CONTEXT(box->storage->user);

i_assert(dt != NULL);
i_assert(muser != NULL);
i_assert(muser->deliver_ctx != NULL);

/* sieve creates multiple transactions, saves the mails and
Expand Down

0 comments on commit 04bdefa

Please sign in to comment.