mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
Fix memory leaks in linphonecore
This commit is contained in:
parent
9723cbe2a7
commit
0cbfac57d3
2 changed files with 9 additions and 3 deletions
|
|
@ -1632,6 +1632,7 @@ static void monitor_network_state(LinphoneCore *lc, time_t curtime){
|
|||
static void proxy_update(LinphoneCore *lc){
|
||||
ms_list_for_each(lc->sip_conf.proxies,(void (*)(void*))&linphone_proxy_config_update);
|
||||
MSList* list=ms_list_copy(lc->sip_conf.deleted_proxies);
|
||||
MSList* copy=list;
|
||||
for(;list!=NULL;list=list->next){
|
||||
LinphoneProxyConfig* cfg = (LinphoneProxyConfig*) list->data;
|
||||
if (ms_time(NULL) - cfg->deletion_date > 5) {
|
||||
|
|
@ -1640,7 +1641,7 @@ static void proxy_update(LinphoneCore *lc){
|
|||
linphone_proxy_config_destroy(cfg);
|
||||
}
|
||||
}
|
||||
ms_list_free(list);
|
||||
ms_list_free(copy);
|
||||
}
|
||||
|
||||
static void assign_buddy_info(LinphoneCore *lc, BuddyInfo *info){
|
||||
|
|
|
|||
|
|
@ -514,8 +514,12 @@ struct _LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyConfig
|
|||
* This will start registration on the proxy, if registration is enabled.
|
||||
**/
|
||||
int linphone_core_add_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *cfg){
|
||||
if (!linphone_proxy_config_check(lc,cfg)) return -1;
|
||||
if (!linphone_proxy_config_check(lc,cfg)) {
|
||||
linphone_proxy_config_destroy(cfg);
|
||||
return -1;
|
||||
}
|
||||
if (ms_list_find(lc->sip_conf.proxies,cfg)!=NULL){
|
||||
linphone_proxy_config_destroy(cfg);
|
||||
ms_warning("ProxyConfig already entered, ignored.");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -549,10 +553,11 @@ void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *cf
|
|||
**/
|
||||
void linphone_core_clear_proxy_config(LinphoneCore *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(list);
|
||||
ms_list_free(copy);
|
||||
linphone_proxy_config_write_all_to_config_file(lc);
|
||||
}
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue