diff options
| author | 2015-08-20 19:31:45 +0000 | |
|---|---|---|
| committer | 2015-08-20 19:31:45 +0000 | |
| commit | 1262059c072375cd5bd48e86b7ee69d66848494d (patch) | |
| tree | 27f5ac34036b013eae33559207b8599f439311de | |
| parent | 5bc17ad258d65c87826ed3c9503b627b03f372b4 (diff) | |
| parent | 260cb53fdb751dd6997b6b6f60a358257c4df82a (diff) | |
am 260cb53f: am ce4fbb4d: Merge "zygote: fix memory leak when fork process"
* commit '260cb53fdb751dd6997b6b6f60a358257c4df82a':
zygote: fix memory leak when fork process
| -rw-r--r-- | core/jni/com_android_internal_os_Zygote.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index 7a725ae75e90..5e7b4447d932 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -358,8 +358,8 @@ static void DetachDescriptors(JNIEnv* env, jintArray fdsToClose) { return; } jsize count = env->GetArrayLength(fdsToClose); - jint *ar = env->GetIntArrayElements(fdsToClose, 0); - if (!ar) { + ScopedIntArrayRO ar(env, fdsToClose); + if (ar.get() == NULL) { ALOGE("Bad fd array"); RuntimeAbort(env); } |