]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
snarf: If sstorage is NULL, do not allocate box
authorAki Tuomi <aki.tuomi@dovecot.fi>
Sun, 14 Jan 2018 18:08:11 +0000 (20:08 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 18 Jan 2018 08:41:18 +0000 (10:41 +0200)
Old code would continue if sstorage was NULL.

Found by static analyzer

src/plugins/snarf/snarf-plugin.c

index 3646c33cae6729c21eabac9d7af989ed9a458266..1c9edac4395b1d0651792b1d41bdee3003857638 100644 (file)
@@ -151,7 +151,7 @@ static void snarf_mailbox_allocated(struct mailbox *box)
 
        if (!box->inbox_user)
                return;
-       if (sstorage != NULL && sstorage->snarfing_disabled)
+       if (sstorage == NULL || sstorage->snarfing_disabled)
                return;
 
        if (!snarf_box_find(box->storage->user, &snarf_list, &snarf_name))