]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dbox: dbox file could have been closed too early in some situations, causing EBADF...
authorTimo Sirainen <tss@iki.fi>
Mon, 15 Nov 2010 15:42:21 +0000 (15:42 +0000)
committerTimo Sirainen <tss@iki.fi>
Mon, 15 Nov 2010 15:42:21 +0000 (15:42 +0000)
src/lib-storage/index/dbox-common/dbox-mail.c

index 7076a6374fa92441b4f2e3f3ef75e50dc416c510..57cc4f66bb1260a6a99336435c350273080034b4 100644 (file)
@@ -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)