diff -rupN dovecot-2.0.beta4/src/plugins/virtual/virtual-config.c dovecot-2.0.beta4.new/src/plugins/virtual/virtual-config.c
--- dovecot-2.0.beta4/src/plugins/virtual/virtual-config.c      2010-05-09 16:09:39.000000000 +0200
+++ dovecot-2.0.beta4.new/src/plugins/virtual/virtual-config.c  2010-05-09 16:13:53.000000000 +0200
@@ -399,10 +399,12 @@ void virtual_config_free(struct virtual_
        struct virtual_backend_box *const *bboxes;
        unsigned int i, count;

-       bboxes = array_get_modifiable(&mbox->backend_boxes, &count);
-       for (i = 0; i < count; i++) {
-               if (bboxes[i]->search_args != NULL)
-                       mail_search_args_unref(&bboxes[i]->search_args);
+       if (array_is_created(&mbox->backend_boxes)) {
+               bboxes = array_get_modifiable(&mbox->backend_boxes, &count);
+               for (i = 0; i < count; i++) {
+                       if (bboxes[i]->search_args != NULL)
+                               mail_search_args_unref(&bboxes[i]->search_args);
+               }
+               array_free(&mbox->backend_boxes);
        }
-       array_free(&mbox->backend_boxes);
 }
