summaryrefslogtreecommitdiffstats
path: root/luni/src/main/native
diff options
context:
space:
mode:
authorNarayan Kamath <narayan@google.com>2015-05-11 16:56:16 +0100
committerNarayan Kamath <narayan@google.com>2015-05-12 10:23:05 +0000
commit3476de58b33f3d57784d8f69b2e7fc9c6a15ac69 (patch)
treeab4c32751bff5c2041878c47b10312c1df8bb1fb /luni/src/main/native
parent45190381fe84506d16b72daa64aa8160952068ea (diff)
downloadlibcore-3476de58b33f3d57784d8f69b2e7fc9c6a15ac69.zip
libcore-3476de58b33f3d57784d8f69b2e7fc9c6a15ac69.tar.gz
libcore-3476de58b33f3d57784d8f69b2e7fc9c6a15ac69.tar.bz2
Fix file descriptor leak when opening invalid archives.
bug: https://code.google.com/p/android/issues/detail?id=171099 Change-Id: I8425d8289839579f1122c61a61ea403f3a7c49fb
Diffstat (limited to 'luni/src/main/native')
-rw-r--r--luni/src/main/native/java_util_jar_StrictJarFile.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/luni/src/main/native/java_util_jar_StrictJarFile.cpp b/luni/src/main/native/java_util_jar_StrictJarFile.cpp
index 82547bd..03d0784 100644
--- a/luni/src/main/native/java_util_jar_StrictJarFile.cpp
+++ b/luni/src/main/native/java_util_jar_StrictJarFile.cpp
@@ -60,6 +60,7 @@ static jlong StrictJarFile_nativeOpenJarFile(JNIEnv* env, jobject, jstring fileN
ZipArchiveHandle handle;
int32_t error = OpenArchive(fileChars.c_str(), &handle);
if (error) {
+ CloseArchive(handle);
throwIoException(env, error);
return static_cast<jlong>(-1);
}