]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_sofia] fix memleak with invalid hostname as gw/proxy
authorDragos Oancea <dragos@signalwire.com>
Mon, 28 Jun 2021 14:28:31 +0000 (14:28 +0000)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:49 +0000 (22:00 +0300)
src/mod/endpoints/mod_sofia/sofia_reg.c

index ae301e9e50976de210d7b7e9af1a34508149bf82..ba9d4d0c71bffd42dc5fa279d584291cf250ee6d 100644 (file)
@@ -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;