]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
virtual: Fixed a crash when freeing an allocated, but unopened mailbox.
authorTimo Sirainen <tss@iki.fi>
Mon, 21 Jun 2010 15:39:12 +0000 (16:39 +0100)
committerTimo Sirainen <tss@iki.fi>
Mon, 21 Jun 2010 15:39:12 +0000 (16:39 +0100)
Based on patch by e-frog.

--HG--
branch : HEAD

src/plugins/virtual/virtual-config.c

index e7a1b816957a22a8e4518f62f21335455e3f0653..974cac510e1c2d27594bf47deb9249059168e1d5 100644 (file)
@@ -400,6 +400,11 @@ void virtual_config_free(struct virtual_mailbox *mbox)
        struct virtual_backend_box *const *bboxes;
        unsigned int i, count;
 
+       if (!array_is_created(&mbox->backend_boxes)) {
+               /* mailbox wasn't opened */
+               return;
+       }
+
        bboxes = array_get_modifiable(&mbox->backend_boxes, &count);
        for (i = 0; i < count; i++) {
                if (bboxes[i]->search_args != NULL)