diff --git a/coreapi/bellesip_sal/sal_address_impl.c b/coreapi/bellesip_sal/sal_address_impl.c index 01a5b6229..f73a06240 100644 --- a/coreapi/bellesip_sal/sal_address_impl.c +++ b/coreapi/bellesip_sal/sal_address_impl.c @@ -123,7 +123,10 @@ void sal_address_set_port(SalAddress *addr, int port){ void sal_address_clean(SalAddress *addr){ belle_sip_header_address_t* header_addr = BELLE_SIP_HEADER_ADDRESS(addr); belle_sip_uri_t* uri=belle_sip_header_address_get_uri(header_addr); - if (uri) belle_sip_parameters_clean(BELLE_SIP_PARAMETERS(uri)); + if (uri) { + belle_sip_parameters_clean(BELLE_SIP_PARAMETERS(uri)); + belle_sip_uri_headers_clean(uri); + } belle_sip_parameters_clean(BELLE_SIP_PARAMETERS(header_addr)); return ; } diff --git a/coreapi/proxy.c b/coreapi/proxy.c index d5bbe3e47..ade9e3a52 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -289,6 +289,8 @@ LinphoneAddress *guess_contact_for_register(LinphoneProxyConfig *obj){ int localport = -1; const char *localip = NULL; LinphoneAddress *contact=linphone_address_new(obj->reg_identity); + + linphone_address_clean(contact); if (obj->contact_params) { // We want to add a list of contacts params to the linphone address