[asterisk-commits] kharwell: branch 1.8 r398102 - in /branches/1.8: channels/ main/ res/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Aug 30 13:55:43 CDT 2013


Author: kharwell
Date: Fri Aug 30 13:55:39 2013
New Revision: 398102

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=398102
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

(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-1.8.patch uploaded by coreyfarrell (license 5909)

Modified:
    branches/1.8/channels/chan_sip.c
    branches/1.8/main/config.c
    branches/1.8/res/res_security_log.c

Modified: branches/1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_sip.c?view=diff&rev=398102&r1=398101&r2=398102
==============================================================================
--- branches/1.8/channels/chan_sip.c (original)
+++ branches/1.8/channels/chan_sip.c Fri Aug 30 13:55:39 2013
@@ -32041,7 +32041,12 @@
 
 	clear_sip_domains();
 	ast_free_ha(sip_cfg.contact_ha);
+	if (sipsock_read_id) {
+		ast_io_remove(io, sipsock_read_id);
+		sipsock_read_id = NULL;
+	}
 	close(sipsock);
+	io_context_destroy(io);
 	sched_context_destroy(sched);
 	con = ast_context_find(used_context);
 	if (con) {
@@ -32054,6 +32059,11 @@
 
 	sip_reqresp_parser_exit();
 	sip_unregister_tests();
+
+	if (notify_types) {
+		ast_config_destroy(notify_types);
+		notify_types = NULL;
+	}
 
 	return 0;
 }

Modified: branches/1.8/main/config.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/config.c?view=diff&rev=398102&r1=398101&r2=398102
==============================================================================
--- branches/1.8/main/config.c (original)
+++ branches/1.8/main/config.c Fri Aug 30 13:55:39 2013
@@ -2975,6 +2975,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: branches/1.8/res/res_security_log.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/res/res_security_log.c?view=diff&rev=398102&r1=398101&r2=398102
==============================================================================
--- branches/1.8/res/res_security_log.c (original)
+++ branches/1.8/res/res_security_log.c Fri Aug 30 13:55:39 2013
@@ -159,6 +159,8 @@
 		security_event_sub = ast_event_unsubscribe(security_event_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