mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 04:28:10 +00:00
Fix memory leaks.
This commit is contained in:
parent
c7ba1b8ee1
commit
43186ab4c9
1 changed files with 12 additions and 6 deletions
|
|
@ -3724,8 +3724,10 @@ JNIEXPORT void JNICALL Java_org_linphone_core_PresenceServiceImpl_unref(JNIEnv *
|
|||
*/
|
||||
JNIEXPORT jstring JNICALL Java_org_linphone_core_PresenceServiceImpl_getId(JNIEnv *env, jobject jobj, jlong ptr) {
|
||||
LinphonePresenceService *service = (LinphonePresenceService *)ptr;
|
||||
const char *cid = linphone_presence_service_get_id(service);
|
||||
return cid ? env->NewStringUTF(cid) : NULL;
|
||||
char *cid = linphone_presence_service_get_id(service);
|
||||
jstring jid = cid ? env->NewStringUTF(cid) : NULL;
|
||||
if (cid) ms_free(cid);
|
||||
return jid;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -3767,8 +3769,10 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_PresenceServiceImpl_setBasicStatus
|
|||
*/
|
||||
JNIEXPORT jstring JNICALL Java_org_linphone_core_PresenceServiceImpl_getContact(JNIEnv *env, jobject jobj, jlong ptr) {
|
||||
LinphonePresenceService *service = (LinphonePresenceService *)ptr;
|
||||
const char *ccontact = linphone_presence_service_get_contact(service);
|
||||
return ccontact ? env->NewStringUTF(ccontact) : NULL;
|
||||
char *ccontact = linphone_presence_service_get_contact(service);
|
||||
jstring jcontact = ccontact ? env->NewStringUTF(ccontact) : NULL;
|
||||
if (ccontact) ms_free(ccontact);
|
||||
return jcontact;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -3854,8 +3858,10 @@ JNIEXPORT void JNICALL Java_org_linphone_core_PresencePersonImpl_unref(JNIEnv *e
|
|||
*/
|
||||
JNIEXPORT jstring JNICALL Java_org_linphone_core_PresencePersonImpl_getId(JNIEnv *env, jobject jobj, jlong ptr) {
|
||||
LinphonePresencePerson *person = (LinphonePresencePerson *)ptr;
|
||||
const char *cid = linphone_presence_person_get_id(person);
|
||||
return cid ? env->NewStringUTF(cid) : NULL;
|
||||
char *cid = linphone_presence_person_get_id(person);
|
||||
jstring jid = cid ? env->NewStringUTF(cid) : NULL;
|
||||
if (cid) ms_free(cid);
|
||||
return jid;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue