]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
trash: Use TRASH_USER_CONTEXT_REQUIRE
authorAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 8 Feb 2018 09:45:20 +0000 (11:45 +0200)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Wed, 21 Feb 2018 07:29:50 +0000 (09:29 +0200)
Satisfies static analyzer

src/plugins/trash/trash-plugin.c

index 170924b8d9d5ab459645551087cc6b5b4aed8f2e..ee1f21b1b8be74e0ca9b074300b36a0b0c44e029 100644 (file)
@@ -18,6 +18,8 @@
 
 #define TRASH_USER_CONTEXT(obj) \
        MODULE_CONTEXT(obj, trash_user_module)
+#define TRASH_USER_CONTEXT_REQUIRE(obj) \
+       MODULE_CONTEXT_REQUIRE(obj, trash_user_module)
 
 struct trash_mailbox {
        const char *name;
@@ -102,7 +104,7 @@ static int trash_try_clean_mails(struct quota_transaction_context *ctx,
                                 uint64_t size_needed,
                                 unsigned int count_needed)
 {
-       struct trash_user *tuser = TRASH_USER_CONTEXT(ctx->quota->user);
+       struct trash_user *tuser = TRASH_USER_CONTEXT_REQUIRE(ctx->quota->user);
        struct trash_mailbox *trashes;
        unsigned int i, j, count, oldest_idx;
        time_t oldest, received = 0;
@@ -285,7 +287,7 @@ static int trash_mailbox_priority_cmp(const struct trash_mailbox *t1,
 
 static int read_configuration(struct mail_user *user, const char *path)
 {
-       struct trash_user *tuser = TRASH_USER_CONTEXT(user);
+       struct trash_user *tuser = TRASH_USER_CONTEXT_REQUIRE(user);
        struct istream *input;
        const char *line, *name;
        struct trash_mailbox *trash;