zygote: fix memory leak when fork process

Release memory allocated by GetIntArrayElements.

Change-Id: If7ce2a78a480e58b0376352ce438dbe51f664f3a
This commit is contained in:
Mykola Kondratenko
2015-07-31 17:22:26 +02:00
committed by Henrik Baard
parent 158560ad66
commit 1ca062f21e

View File

@@ -356,8 +356,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);
}