From: Timo Sirainen Date: Fri, 1 Jul 2016 13:27:30 +0000 (+0300) Subject: LAYOUT=index: Make sure error is preserved if created mailbox can't be added to list... X-Git-Tag: 2.3.0.rc1~3349 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=395aa4fe4639d13f37a470409d879f1c2b11254a;p=thirdparty%2Fdovecot%2Fcore.git LAYOUT=index: Make sure error is preserved if created mailbox can't be added to list index. mailbox_delete() could overwrite the error. --- diff --git a/src/lib-storage/list/mailbox-list-index-backend.c b/src/lib-storage/list/mailbox-list-index-backend.c index 4cef1bcf69..492924d053 100644 --- a/src/lib-storage/list/mailbox-list-index-backend.c +++ b/src/lib-storage/list/mailbox-list-index-backend.c @@ -374,8 +374,14 @@ index_list_mailbox_create(struct mailbox *box, if (ret <= 0) { /* failed to add to list. rollback the backend mailbox creation */ + bool create_error = ret < 0; + + if (create_error) + mail_storage_last_error_push(box->storage); if (mailbox_delete(box) < 0) ret = -1; + if (create_error) + mail_storage_last_error_pop(box->storage); } } list->create_mailbox_name = old_name;