space leak in the Java binding

This commit is contained in:
kr.angelov
2013-10-03 21:00:45 +00:00
parent 4c277ee268
commit 96399838b7

View File

@@ -53,7 +53,9 @@ gu2j_string(JNIEnv *env, GuString s) {
static GuString static GuString
j2gu_string(JNIEnv *env, jstring s, GuPool* pool) { j2gu_string(JNIEnv *env, jstring s, GuPool* pool) {
const char *str = (*env)->GetStringUTFChars(env, s, 0); const char *str = (*env)->GetStringUTFChars(env, s, 0);
return gu_str_string(str, pool); GuString s = gu_str_string(str, pool);
(*env)->ReleaseStringUTFChars(env, s, str);
return s;
} }
static void* static void*