]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix various memory leaks
authorKevin Harwell <kharwell@digium.com>
Fri, 30 Aug 2013 18:55:39 +0000 (18:55 +0000)
committerKevin Harwell <kharwell@digium.com>
Fri, 30 Aug 2013 18:55:39 +0000 (18:55 +0000)
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)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@398102 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c
main/config.c
res/res_security_log.c

index 181ce3901f52a0b1300c19d9bf24c35cabedb429..cd7c70e03c31c5c145c2d92ca7a66aeff1452f48 100644 (file)
@@ -32041,7 +32041,12 @@ static int unload_module(void)
 
        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) {
@@ -32055,6 +32060,11 @@ static int unload_module(void)
        sip_reqresp_parser_exit();
        sip_unregister_tests();
 
+       if (notify_types) {
+               ast_config_destroy(notify_types);
+               notify_types = NULL;
+       }
+
        return 0;
 }
 
index 0ff2d841e97d0926dae69f435c4a8a29d45b4927..103a1c9f7069c466b973d7d70fd7b7d7007f9570 100644 (file)
@@ -2975,6 +2975,10 @@ static void config_shutdown(void)
 
        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);
index 3e8c48a24e73aed53db221b91cad7d5ae2d8cf78..8611e3f592a40ae0d9726420489681c27f59eae9 100644 (file)
@@ -159,6 +159,8 @@ static int unload_module(void)
                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;