envoyproxy / envoyproxy/envoy-mobile

jni: call `ReleaseStringUTFChars` where appropriate

Open
#1,187 0 comments 0 reactions 0 assignees View on GitHub
bug no stalebot platform/android
Dominant language
Java
Stars
566
Forks
85
PR merge metrics
No merged PRs in 30d

Description

According to [this resource](http://journals.ecs.soton.ac.uk/java/tutorial/native1.1/implementing/string.html):

> Note that when your native code is finished using the UTF-8 string, it must call ReleaseStringUTFChars. ReleaseStringUTFChars informs the VM that the native method is finished with the string, so that the memory taken by the UTF-8 string can then be freed. Failing to call ReleaseStringUTFChars results in a memory leak. This will ultimately lead to system memory exhaustion.

Unfortunately, there are many places in jni_interface.cc where this does not happen.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.