Merge "zygote: fix memory leak when fork process"

This commit is contained in:
Elliott Hughes
2015-08-20 01:14:00 +00:00
committed by Gerrit Code Review

View File

@@ -356,8 +356,8 @@ static void DetachDescriptors(JNIEnv* env, jintArray fdsToClose) {
return; return;
} }
jsize count = env->GetArrayLength(fdsToClose); jsize count = env->GetArrayLength(fdsToClose);
jint *ar = env->GetIntArrayElements(fdsToClose, 0); ScopedIntArrayRO ar(env, fdsToClose);
if (!ar) { if (ar.get() == NULL) {
ALOGE("Bad fd array"); ALOGE("Bad fd array");
RuntimeAbort(env); RuntimeAbort(env);
} }