From d697939bbe93fbab2091ebe0ad06d313f08808c5 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Tue, 7 Jul 2015 16:38:44 +0200 Subject: [PATCH] proxy.c: fix crash regression from cddb9c3, list copy is actually required --- coreapi/proxy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 6afa2d679..2cfa26b20 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -1232,10 +1232,12 @@ void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *cf } void linphone_core_clear_proxy_config(LinphoneCore *lc){ - const MSList* list=linphone_core_get_proxy_config_list(lc); + MSList* list=ms_list_copy(linphone_core_get_proxy_config_list((const LinphoneCore*)lc)); + MSList* copy=list; for(;list!=NULL;list=list->next){ linphone_core_remove_proxy_config(lc,(LinphoneProxyConfig *)list->data); } + ms_list_free(copy); linphone_proxy_config_write_all_to_config_file(lc); }