android: Fix leak of JNI local ref in IMC when creating string array

Fixes: 036fa7a166 ("android: Overload for getMeasurement() that takes a String array as argument")
This commit is contained in:
Tobias Brunner committed 2026-07-24 08:47:38 +02:00
1 parent dd6a984afb
commit 455b3e2298
1 file changed
+1
@@ -192,6 +192,7 @@ static jobjectArray string_array_create(JNIEnv *env, enumerator_t *enumerator)
goto failed; goto failed;
} }
(*env)->SetObjectArrayElement(env, jarray, i++, jstring); (*env)->SetObjectArrayElement(env, jarray, i++, jstring);
(*env)->DeleteLocalRef(env, jstring);
} }
enumerator->destroy(enumerator); enumerator->destroy(enumerator);
list->destroy(list); list->destroy(list);