diff --git a/src/com/fsck/k9/mail/store/LocalStore.java b/src/com/fsck/k9/mail/store/LocalStore.java index 8756fe5ee..5575499a7 100644 --- a/src/com/fsck/k9/mail/store/LocalStore.java +++ b/src/com/fsck/k9/mail/store/LocalStore.java @@ -4010,11 +4010,15 @@ public class LocalStore extends Store implements Serializable { @Override public void writeTo(OutputStream out) throws IOException, MessagingException { InputStream in = getInputStream(); - Base64OutputStream base64Out = new Base64OutputStream(out); try { - IOUtils.copy(in, base64Out); + Base64OutputStream base64Out = new Base64OutputStream(out); + try { + IOUtils.copy(in, base64Out); + } finally { + base64Out.close(); + } } finally { - base64Out.close(); + in.close(); } }