Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 397590) +++ channels/chan_sip.c (working copy) @@ -28069,6 +28069,7 @@ /* size of the string making up the cause code is "SIP " + cause length */ data_size += 4 + strlen(REQ_OFFSET_TO_STR(req, rlpart2)); cause_code = ast_alloca(data_size); + memset(cause_code, 0, data_size); ast_copy_string(cause_code->chan_name, ast_channel_name(p->owner), AST_CHANNEL_NAME); @@ -34716,7 +34717,12 @@ clear_sip_domains(); sip_cfg.contact_acl = ast_free_acl_list(sip_cfg.contact_acl); + if (sipsock_read_id) { + ast_io_remove(io, sipsock_read_id); + sipsock_read_id = NULL; + } close(sipsock); + io_context_destroy(io); ast_sched_context_destroy(sched); con = ast_context_find(used_context); if (con) { @@ -34730,6 +34736,11 @@ sip_reqresp_parser_exit(); sip_unregister_tests(); + if (notify_types) { + ast_config_destroy(notify_types); + notify_types = NULL; + } + ast_format_cap_destroy(sip_tech.capabilities); sip_cfg.caps = ast_format_cap_destroy(sip_cfg.caps);