From a0d1ddf83039e192bf492618c6b68520a524d282 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Mon, 24 Apr 2017 10:09:32 +0200 Subject: [PATCH] Fix get_identity of account_creator --- coreapi/account_creator.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/coreapi/account_creator.c b/coreapi/account_creator.c index 7c048b17b..4be0e83d6 100644 --- a/coreapi/account_creator.c +++ b/coreapi/account_creator.c @@ -77,14 +77,16 @@ static char* _get_identity(const LinphoneAccountCreator *creator) { char *identity = NULL; if ((creator->username || creator->phone_number)) { //we must escape username - LinphoneProxyConfig* proxy = creator->proxy_cfg; + LinphoneProxyConfig* proxy = linphone_core_create_proxy_config(creator->core); LinphoneAddress* addr; addr = linphone_proxy_config_normalize_sip_uri(proxy, creator->username ? creator->username : creator->phone_number); - if (addr == NULL) return NULL; + if (addr == NULL) goto end; identity = linphone_address_as_string(addr); linphone_address_unref(addr); + end: + linphone_proxy_config_destroy(proxy); } return identity; }