EXPORTED int mailbox_rename_cleanup(struct mailbox **mailboxptr)
{

    int r = 0;
    struct mailbox *oldmailbox = *mailboxptr;
    char *name = xstrdup(mailbox_name(oldmailbox));

    r = mailbox_delete_internal(mailboxptr);

    if (r) {
        syslog(LOG_CRIT,
               "Rename Failure during mailbox_rename_cleanup (%s), " \
               "potential leaked space (%s)", name,
               error_message(r));
    }
    free(name);

    return r;
}
EXPORTED int mailbox_rename_cleanup(struct mailbox **mailboxptr)
{

    int r = 0;
    struct mailbox *oldmailbox = *mailboxptr;
    char *name = xstrdup(mailbox_name(oldmailbox));

    r = mailbox_delete_internal(mailboxptr);

    if (r) {
        syslog(LOG_CRIT,
               "Rename Failure during mailbox_rename_cleanup (%s), " \
               "potential leaked space (%s)", name,
               error_message(r));
    }
    free(name);

    return r;
}