From 564195bad98ee6e5dd3885fe56350aa1cef1e87b Mon Sep 17 00:00:00 2001 From: Joe Steele Date: Wed, 7 Aug 2013 19:20:49 -0400 Subject: [PATCH] Close stream when done (StrictMode error) --- src/com/fsck/k9/mail/store/LocalStore.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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(); } }