From 0cf7325c4b53921d1b6a61ac486149beea77516d Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Fri, 16 Mar 2018 15:58:48 +0100 Subject: [PATCH] Fix memory leak with proxy config routes. --- coreapi/proxy.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 067b95790..bad2e9aa4 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -1228,7 +1228,10 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore* lc CONFIGURE_STRING_VALUE(cfg,config,key,identity,"reg_identity") CONFIGURE_STRING_VALUE(cfg,config,key,server_addr,"reg_proxy") - linphone_proxy_config_set_routes(cfg, linphone_config_get_string_list(config, key, "reg_route", NULL)); + bctbx_list_t *routes = linphone_config_get_string_list(config, key, "reg_route", NULL); + linphone_proxy_config_set_routes(cfg, routes); + if (routes) + bctbx_list_free_with_data(routes, (bctbx_list_free_func)bctbx_free); CONFIGURE_STRING_VALUE(cfg,config,key,realm,"realm")