From 76c884abbaf001812e3d3f493dd2892ade37c613 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Tue, 5 Sep 2017 16:11:11 +0200 Subject: [PATCH] fix(core): avoid memory leaks --- coreapi/event.c | 3 +++ coreapi/proxy.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/coreapi/event.c b/coreapi/event.c index 559faf0a5..221a6aa63 100644 --- a/coreapi/event.c +++ b/coreapi/event.c @@ -420,6 +420,9 @@ static void linphone_event_destroy(LinphoneEvent *lev){ if (lev->ei) linphone_error_info_unref(lev->ei); if (lev->op) sal_op_release(lev->op); if (lev->send_custom_headers) sal_custom_header_free(lev->send_custom_headers); + if (lev->to_address) linphone_address_unref(lev->to_address); + if (lev->from_address) linphone_address_unref(lev->from_address); + ms_free(lev->name); } diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 3ff04b9b7..3dcf0ab7d 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -246,6 +246,9 @@ void _linphone_proxy_config_destroy(LinphoneProxyConfig *cfg){ if (cfg->ei){ linphone_error_info_unref(cfg->ei); } + + if (cfg->contact_address) linphone_address_unref(cfg->contact_address); + _linphone_proxy_config_release_ops(cfg); }