Commit b764d644 authored by Erwan Croze's avatar Erwan Croze 👋🏻

Fixing leak in JNI concerning file transfert

parent 77eb02d3
......@@ -1530,6 +1530,9 @@ public:
jcontent,
jbytes,
size);
if (jbytes) {
env->DeleteLocalRef(jbytes);
}
if (jcontent) {
env->DeleteLocalRef(jcontent);
}
......@@ -6226,6 +6229,9 @@ static jobject create_java_linphone_content(JNIEnv *env, const LinphoneContent *
env->DeleteLocalRef(contentClass);
env->DeleteLocalRef(jtype);
env->DeleteLocalRef(jsubtype);
if (jdata) {
env->DeleteLocalRef(jdata);
}
if (jencoding) {
env->DeleteLocalRef(jencoding);
}
......@@ -6252,6 +6258,7 @@ static jobject create_java_linphone_buffer(JNIEnv *env, const LinphoneBuffer *bu
}
jobject jobj = env->NewObject(bufferClass, ctor, jdata, jsize);
if (jdata) env->DeleteLocalRef(jdata);
env->DeleteLocalRef(bufferClass);
return jobj;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment