struct quota_root *const *roots;
unsigned int i, count;
- *_quota = NULL;
-
roots = array_get("a->roots, &count);
for (i = 0; i < count; i++)
quota_root_deinit(roots[i]);
+
+ /* deinit quota roots before setting quser->quota=NULL */
+ *_quota = NULL;
+
array_free("a->roots);
array_free("a->namespaces);
i_free(quota);
ctx->quota = box->list->ns->owner != NULL ?
quota_get_mail_user_quota(box->list->ns->owner) :
quota_get_mail_user_quota(box->list->ns->user);
+ i_assert(ctx->quota != NULL);
+
ctx->box = box;
ctx->bytes_left = (uint64_t)-1;
ctx->count_left = (uint64_t)-1;