From: Dragos Oancea Date: Mon, 28 Jun 2021 14:28:31 +0000 (+0000) Subject: [mod_sofia] fix memleak with invalid hostname as gw/proxy X-Git-Tag: v1.10.7^2~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=392bc26a43995efbe2134cc89a10661603a79e18;p=thirdparty%2Ffreeswitch.git [mod_sofia] fix memleak with invalid hostname as gw/proxy --- diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index ae301e9e50..ba9d4d0c71 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -203,12 +203,14 @@ void sofia_reg_unregister(sofia_profile_t *profile) if (gateway_ptr->state == REG_STATE_REGED) { sofia_reg_kill_reg(gateway_ptr); } + sofia_private_free(gateway_ptr->sofia_private); for (gw_sub_ptr = gateway_ptr->subscriptions; gw_sub_ptr; gw_sub_ptr = gw_sub_ptr->next) { if (gw_sub_ptr->state == SUB_STATE_SUBED) { sofia_reg_kill_sub(gw_sub_ptr); } + sofia_private_free(gw_sub_ptr->sofia_private); } gateway_ptr->subscriptions = NULL;