From: Timo Sirainen Date: Mon, 15 Nov 2010 15:42:21 +0000 (+0000) Subject: dbox: dbox file could have been closed too early in some situations, causing EBADF... X-Git-Tag: 2.0.8~94 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=010affb9f4b9cca9b94e1d8d570cf179daff08d7;p=thirdparty%2Fdovecot%2Fcore.git dbox: dbox file could have been closed too early in some situations, causing EBADF errors. --- diff --git a/src/lib-storage/index/dbox-common/dbox-mail.c b/src/lib-storage/index/dbox-common/dbox-mail.c index 7076a6374f..57cc4f66bb 100644 --- a/src/lib-storage/index/dbox-common/dbox-mail.c +++ b/src/lib-storage/index/dbox-common/dbox-mail.c @@ -32,9 +32,11 @@ void dbox_mail_close(struct mail *_mail) { struct dbox_mail *mail = (struct dbox_mail *)_mail; + index_mail_close(_mail); + /* close the dbox file only after index is closed, since it may still + try to read from it. */ if (mail->open_file != NULL) dbox_file_unref(&mail->open_file); - index_mail_close(_mail); } int dbox_mail_metadata_read(struct dbox_mail *mail, struct dbox_file **file_r)