From c44b19cda669bcaa60038635fd187b36e7c3ebdf Mon Sep 17 00:00:00 2001 From: Andrew Chen Date: Fri, 7 Sep 2012 20:27:35 -0700 Subject: [PATCH] Close input stream after reading to fix strict mode warning. --- src/com/fsck/k9/mail/internet/MimeUtility.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/com/fsck/k9/mail/internet/MimeUtility.java b/src/com/fsck/k9/mail/internet/MimeUtility.java index 55b360cde..8edf9aea5 100644 --- a/src/com/fsck/k9/mail/internet/MimeUtility.java +++ b/src/com/fsck/k9/mail/internet/MimeUtility.java @@ -1060,8 +1060,15 @@ public class MimeUtility { * Now we read the part into a buffer for further processing. Because * the stream is now wrapped we'll remove any transfer encoding at this point. */ - InputStream in = part.getBody().getInputStream(); - return readToString(in, charset); + InputStream in = null; + try { + in = part.getBody().getInputStream(); + return readToString(in, charset); + } finally { + if (in != null) { + in.close(); + } + } } }