static void _cleanup_changes(struct mailbox *mailbox)
{
    uint32_t i;
    for (i = 0; i < mailbox->index_change_count; i++) {
        free(mailbox->index_changes[i].msgid);
    }
    free(mailbox->index_changes);
    mailbox->index_changes = NULL;
    mailbox->index_change_count = 0;
    mailbox->index_change_alloc = 0;
    memset(mailbox->index_change_map, 0, sizeof(uint32_t)*INDEX_MAP_SIZE);
}
static void _cleanup_changes(struct mailbox *mailbox)
{
    uint32_t i;
    for (i = 0; i < mailbox->index_change_count; i++) {
        free(mailbox->index_changes[i].msgid);
    }
    free(mailbox->index_changes);
    mailbox->index_changes = NULL;
    mailbox->index_change_count = 0;
    mailbox->index_change_alloc = 0;
    memset(mailbox->index_change_map, 0, sizeof(uint32_t)*INDEX_MAP_SIZE);
}