From 5e80df36faf652c6e8d4c21dae224e91ff117c4e Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 28 Sep 2017 15:31:29 +0200 Subject: [PATCH] Fix memory leaks. --- coreapi/proxy.c | 2 ++ src/c-wrapper/api/c-address.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 8268edff6..a74eefa0b 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -248,6 +248,8 @@ void _linphone_proxy_config_destroy(LinphoneProxyConfig *cfg){ } if (cfg->contact_address) linphone_address_unref(cfg->contact_address); + if (cfg->contact_address_without_params) + linphone_address_unref(cfg->contact_address_without_params); _linphone_proxy_config_release_ops(cfg); } diff --git a/src/c-wrapper/api/c-address.cpp b/src/c-wrapper/api/c-address.cpp index e258d888a..f4a38b414 100644 --- a/src/c-wrapper/api/c-address.cpp +++ b/src/c-wrapper/api/c-address.cpp @@ -36,6 +36,7 @@ LinphoneAddress *linphone_address_new (const char *address) { LinphoneAddress *object = L_INIT(Address); L_SET_CPP_PTR_FROM_C_OBJECT(object, cppPtr); + delete cppPtr; return object; }