From 4cb8038cb008adb3c12e7c4a191bcd6647ee7c46 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Mon, 22 Oct 2018 16:05:40 +0200 Subject: [PATCH] fix(core): add a linphone_core_create_primary_contact_parsed function to avoid leak with wrappers --- coreapi/linphonecore.c | 4 ++++ include/linphone/core.h | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index d87a68909..a9e91a094 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2672,6 +2672,10 @@ LinphoneAddress *linphone_core_get_primary_contact_parsed(LinphoneCore *lc){ return linphone_address_new(linphone_core_get_primary_contact(lc)); } +LinphoneAddress *linphone_core_create_primary_contact_parsed (LinphoneCore *lc) { + return linphone_address_new(linphone_core_get_primary_contact(lc)); +} + LinphoneStatus linphone_core_set_audio_codecs(LinphoneCore *lc, bctbx_list_t *codecs){ if (lc->codecs_conf.audio_codecs!=NULL) bctbx_list_free(lc->codecs_conf.audio_codecs); lc->codecs_conf.audio_codecs=codecs; diff --git a/include/linphone/core.h b/include/linphone/core.h index 0fcc2db96..c5a0b9dc6 100644 --- a/include/linphone/core.h +++ b/include/linphone/core.h @@ -1557,12 +1557,21 @@ LINPHONE_PUBLIC void linphone_core_enable_ipv6(LinphoneCore *lc, bool_t val); /** * Same as linphone_core_get_primary_contact() but the result is a #LinphoneAddress object - * instead of const char* + * instead of const char *. * * @ingroup proxies + * @deprecated Use linphone_core_create_primary_contact_parsed() instead. Deprecated since 2018-10-22. **/ LINPHONE_PUBLIC LinphoneAddress *linphone_core_get_primary_contact_parsed(LinphoneCore *lc); +/** + * Same as linphone_core_get_primary_contact() but the result is a #LinphoneAddress object + * instead of const char *. + * + * @ingroup proxies +**/ +LINPHONE_PUBLIC LinphoneAddress *linphone_core_create_primary_contact_parsed (LinphoneCore *lc); + LINPHONE_PUBLIC const char * linphone_core_get_identity(LinphoneCore *lc); /** -- 2.21.0