summaryrefslogtreecommitdiffstats
path: root/emailcommon/src/com/android/emailcommon
diff options
context:
space:
mode:
Diffstat (limited to 'emailcommon/src/com/android/emailcommon')
-rwxr-xr-x[-rw-r--r--]emailcommon/src/com/android/emailcommon/internet/Rfc822Output.java9
-rwxr-xr-x[-rw-r--r--]emailcommon/src/com/android/emailcommon/utility/Utility.java3
2 files changed, 12 insertions, 0 deletions
diff --git a/emailcommon/src/com/android/emailcommon/internet/Rfc822Output.java b/emailcommon/src/com/android/emailcommon/internet/Rfc822Output.java
index d7486eec7..d3fbddfd5 100644..100755
--- a/emailcommon/src/com/android/emailcommon/internet/Rfc822Output.java
+++ b/emailcommon/src/com/android/emailcommon/internet/Rfc822Output.java
@@ -282,6 +282,15 @@ public class Rfc822Output {
"when sending attachment");
throw new MessagingException("Invalid attachment.", ioe);
}
+ finally {
+ try {
+ if (inStream != null) {
+ inStream.close();
+ }
+ } catch (IOException e) {
+ LogUtils.e(TAG, e, "Failed to close stream");
+ }
+ }
}
/**
diff --git a/emailcommon/src/com/android/emailcommon/utility/Utility.java b/emailcommon/src/com/android/emailcommon/utility/Utility.java
index 22ee18def..1e38542ad 100644..100755
--- a/emailcommon/src/com/android/emailcommon/utility/Utility.java
+++ b/emailcommon/src/com/android/emailcommon/utility/Utility.java
@@ -824,6 +824,9 @@ public class Utility {
while ((n = gunzip.read(buffer)) >= 0) {
out.write(buffer, 0, n);
}
+ if (gunzip != null) {
+ gunzip.close();
+ }
return out.toString();
} catch (IOException e) {
e.printStackTrace();