zygote: fix memory leak when fork process
Release memory allocated by GetIntArrayElements. Change-Id: If7ce2a78a480e58b0376352ce438dbe51f664f3a
This commit is contained in:
committed by
Henrik Baard
parent
158560ad66
commit
1ca062f21e
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user