diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-16 17:24:31 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2017-06-16 17:24:31 +0000 |
commit | 0f0911209682af154045adcf3cd6afdb225f2911 (patch) | |
tree | 492c06e87563119fb810abfe4ab1c46ce0133d21 | |
parent | 343b8d8f914162c60e4ad7da9cda6a967c4ba9af (diff) | |
parent | 556401edb396cb69cd932701b830cc3e87254b6c (diff) | |
download | base-nougat-mr2.1-release.tar.gz |
Merge cherrypicks of [2419750, 2419599, 2419638, 2419698, 2419640, 2419699, 2419728, 2419801, 2419821, 2419763, 2419753, 2419600, 2419802, 2419783, 2419841, 2419822, 2419676, 2419754, 2419764, 2419729, 2419700, 2419765, 2419823, 2419730, 2419824, 2419755, 2419715, 2419716, 2419733, 2419829, 2419869, 2419870, 2419805, 2419871, 2419786] into nyc-mr2-security-a-releaseandroid-7.1.2_r30nougat-mr2.1-release
Change-Id: Ie1f885f2c67f4548560af308dd00f207db8a2289
-rw-r--r-- | media/java/android/media/MediaHTTPConnection.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/media/java/android/media/MediaHTTPConnection.java b/media/java/android/media/MediaHTTPConnection.java index d6bf421ffa9f..dda5ce6fd083 100644 --- a/media/java/android/media/MediaHTTPConnection.java +++ b/media/java/android/media/MediaHTTPConnection.java @@ -135,7 +135,13 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub { private void teardownConnection() { if (mConnection != null) { - mInputStream = null; + if (mInputStream != null) { + try { + mInputStream.close(); + } catch (IOException e) { + } + mInputStream = null; + } mConnection.disconnect(); mConnection = null; @@ -297,8 +303,7 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub { mCurrentOffset = offset; } catch (IOException e) { mTotalSize = -1; - mInputStream = null; - mConnection = null; + teardownConnection(); mCurrentOffset = -1; throw e; |