From 010affb9f4b9cca9b94e1d8d570cf179daff08d7 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 15 Nov 2010 15:42:21 +0000 Subject: [PATCH] dbox: dbox file could have been closed too early in some situations, causing EBADF errors. --- src/lib-storage/index/dbox-common/dbox-mail.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) -- 2.47.3