[asterisk-commits] kharwell: trunk r398124 - in /trunk: ./ channels/ main/ res/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Aug 30 14:23:02 CDT 2013
Author: kharwell
Date: Fri Aug 30 14:22:59 2013
New Revision: 398124
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=398124
Log:
Fix various memory leaks
main/config.c - cleanup cache fie includes
res/res_security_log.c - unregister logger level
channesl/chan_sip.c - cleanup io context and notify_types
main/translator.c - cleanup at shutdown
main/named_acl.c - cleanup cli commands
main/indications.c - ast_get_indication_tone() unref default_tone_zone if used
(closes issues ASTERISK-22378)
Reported by: Corey Farrell
Patches:
config_shutdown.patch uploaded by coreyfarrell (license 5909)
res_security_log.patch uploaded by coreyfarrell (license 5909)
chan_sip-11.patch uploaded by coreyfarrell (license 5909)
indications_refleak.patch uploaded by coreyfarrell (license 5909)
named_acl-cli_unreg-trunk.patch uploaded by coreyfarrell (license 5909)
translate_shutdown.patch uploaded by coreyfarrell (license 5909)
........
Merged revisions 398102 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 398103 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 398116 from http://svn.asterisk.org/svn/asterisk/branches/12
Modified:
trunk/ (props changed)
trunk/channels/chan_sip.c
trunk/main/config.c
trunk/main/indications.c
trunk/main/named_acl.c
trunk/main/translate.c
trunk/res/res_security_log.c
Propchange: trunk/
------------------------------------------------------------------------------
--- branch-12-merged (original)
+++ branch-12-merged Fri Aug 30 14:22:59 2013
@@ -1,1 +1,1 @@
-/branches/12:1-397989,398002,398016,398020,398023,398025,398062,398068,398100
+/branches/12:1-397989,398002,398016,398020,398023,398025,398062,398068,398100,398116
Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=398124&r1=398123&r2=398124
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Fri Aug 30 14:22:59 2013
@@ -34662,7 +34662,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) {
@@ -34675,6 +34680,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);
Modified: trunk/main/config.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/config.c?view=diff&rev=398124&r1=398123&r2=398124
==============================================================================
--- trunk/main/config.c (original)
+++ trunk/main/config.c Fri Aug 30 14:22:59 2013
@@ -3248,6 +3248,10 @@
AST_LIST_LOCK(&cfmtime_head);
while ((cfmtime = AST_LIST_REMOVE_HEAD(&cfmtime_head, list))) {
+ struct cache_file_include *cfinclude;
+ while ((cfinclude = AST_LIST_REMOVE_HEAD(&cfmtime->includes, list))) {
+ ast_free(cfinclude);
+ }
ast_free(cfmtime);
}
AST_LIST_UNLOCK(&cfmtime_head);
Modified: trunk/main/indications.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/indications.c?view=diff&rev=398124&r1=398123&r2=398124
==============================================================================
--- trunk/main/indications.c (original)
+++ trunk/main/indications.c Fri Aug 30 14:22:59 2013
@@ -499,6 +499,9 @@
ast_tone_zone_unlock(zone);
+ if (!_zone)
+ zone = ast_tone_zone_unref(zone);
+
return ts;
}
Modified: trunk/main/named_acl.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/named_acl.c?view=diff&rev=398124&r1=398123&r2=398124
==============================================================================
--- trunk/main/named_acl.c (original)
+++ trunk/main/named_acl.c Fri Aug 30 14:22:59 2013
@@ -567,6 +567,8 @@
static void named_acl_cleanup(void)
{
+ ast_cli_unregister_multiple(cli_named_acl, ARRAY_LEN(cli_named_acl));
+
STASIS_MESSAGE_TYPE_CLEANUP(ast_named_acl_change_type);
aco_info_destroy(&cfg_info);
ao2_global_obj_release(globals);
Modified: trunk/main/translate.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/translate.c?view=diff&rev=398124&r1=398123&r2=398124
==============================================================================
--- trunk/main/translate.c (original)
+++ trunk/main/translate.c Fri Aug 30 14:22:59 2013
@@ -1396,11 +1396,27 @@
ast_format_cap_iter_end(src);
}
+static void translate_shutdown(void)
+{
+ int x;
+ ast_cli_unregister_multiple(cli_translate, ARRAY_LEN(cli_translate));
+
+ ast_rwlock_wrlock(&tablelock);
+ for (x = 0; x < index_size; x++) {
+ ast_free(__matrix[x]);
+ }
+ ast_free(__matrix);
+ ast_free(__indextable);
+ ast_rwlock_unlock(&tablelock);
+ ast_rwlock_destroy(&tablelock);
+}
+
int ast_translate_init(void)
{
int res = 0;
ast_rwlock_init(&tablelock);
res = matrix_resize(1);
res |= ast_cli_register_multiple(cli_translate, ARRAY_LEN(cli_translate));
+ ast_register_atexit(translate_shutdown);
return res;
}
Modified: trunk/res/res_security_log.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_security_log.c?view=diff&rev=398124&r1=398123&r2=398124
==============================================================================
--- trunk/res/res_security_log.c (original)
+++ trunk/res/res_security_log.c Fri Aug 30 14:22:59 2013
@@ -155,6 +155,8 @@
security_stasis_sub = stasis_unsubscribe(security_stasis_sub);
}
+ ast_logger_unregister_level(LOG_SECURITY_NAME);
+
ast_verb(3, "Security Logging Disabled\n");
return 0;
More information about the asterisk-commits
mailing list