From daf5fba2d0071ba266b08ca0f769be804bfa34fc Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Fri, 9 Oct 2020 15:16:57 +0200 Subject: [PATCH] Fix crash caused by use of linphoneAddress variable after destroying it --- Classes/LinphoneCoreSettingsStore.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Classes/LinphoneCoreSettingsStore.m b/Classes/LinphoneCoreSettingsStore.m index 9d0aacf72..1b4118483 100644 --- a/Classes/LinphoneCoreSettingsStore.m +++ b/Classes/LinphoneCoreSettingsStore.m @@ -547,7 +547,6 @@ linphone_address_set_domain(linphoneAddress, [domain UTF8String]); linphone_address_set_display_name(linphoneAddress, (displayName.length ? displayName.UTF8String : NULL)); const char *identity = linphone_address_as_string(linphoneAddress); - linphone_address_destroy(linphoneAddress); const char *password = [accountPassword UTF8String]; const char *ha1 = [accountHa1 UTF8String]; @@ -636,7 +635,9 @@ bad_proxy: if (proxy) ms_free(proxy); - + if (linphoneAddress) + linphone_address_destroy(linphoneAddress); + // in case of error, show an alert to the user if (error != nil) { linphone_proxy_config_done(proxyCfg);