]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Destroy configs when they are no longer used
authorTerry Wilson <twilson@digium.com>
Wed, 28 Mar 2012 19:20:04 +0000 (19:20 +0000)
committerTerry Wilson <twilson@digium.com>
Wed, 28 Mar 2012 19:20:04 +0000 (19:20 +0000)
https://reviewboard.asterisk.org/r/1834/
........

Merged revisions 360712 from http://svn.asterisk.org/svn/asterisk/branches/1.8

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

addons/cdr_mysql.c
addons/chan_ooh323.c
cdr/cdr_adaptive_odbc.c
channels/chan_gtalk.c
channels/chan_jingle.c

index ecdfaea0bd114714988cfb105d637b86e8a9a74e..445f9e3d0553daca76e22ff84d64885f65174645 100644 (file)
@@ -462,6 +462,7 @@ static int my_load_module(int reload)
                if (reload) {
                        AST_RWLIST_UNLOCK(&columns);
                }
+               ast_config_destroy(cfg);
                return AST_MODULE_LOAD_SUCCESS;
        }
 
@@ -502,6 +503,7 @@ static int my_load_module(int reload)
                if (reload) {
                        AST_RWLIST_UNLOCK(&columns);
                }
+               ast_config_destroy(cfg);
                return AST_MODULE_LOAD_FAILURE;
        }
 
index d7a63bf809f156b250ad6052ff8eeba4c862f06e..1b7525ef9b4512aeb393e39d7b6f8fea1d55e672 100644 (file)
@@ -2686,6 +2686,7 @@ int reload_config(int reload)
                        ast_copy_string(gIP, v->value, sizeof(gIP));
                        if (ast_parse_arg(v->value, PARSE_ADDR, &bindaddr)) {
                                ast_log(LOG_WARNING, "Invalid address: %s\n", v->value);
+                               ast_config_destroy(cfg);
                                return 1;
                        }
                        if (ast_sockaddr_is_ipv6(&bindaddr)) {
@@ -2739,6 +2740,7 @@ int reload_config(int reload)
                        pNewAlias = ast_calloc(1, sizeof(struct ooAliases));
                        if (!pNewAlias) {
                                ast_log(LOG_ERROR, "Failed to allocate memory for h323id alias\n");
+                               ast_config_destroy(cfg);
                                return 1;
                        }
                        if (gAliasList == NULL) { /* first h323id - set as callerid if callerid is not set */
@@ -2753,6 +2755,7 @@ int reload_config(int reload)
                        pNewAlias = ast_calloc(1, sizeof(struct ooAliases));
                        if (!pNewAlias) {
                                ast_log(LOG_ERROR, "Failed to allocate memory for e164 alias\n");
+                               ast_config_destroy(cfg);
                                return 1;
                        }
                        pNewAlias->type =  T_H225AliasAddress_dialedDigits;
@@ -2764,6 +2767,7 @@ int reload_config(int reload)
                        pNewAlias = ast_calloc(1, sizeof(struct ooAliases));
                        if (!pNewAlias) {
                                ast_log(LOG_ERROR, "Failed to allocate memory for email alias\n");
+                               ast_config_destroy(cfg);
                                return 1;
                        }
                        pNewAlias->type =  T_H225AliasAddress_email_ID;
index c4ffa16c6bd468981c628bafb00279509e23ad95..0c4bb8a47428519c3a92cd956c3ec2cd837940d1 100644 (file)
@@ -272,6 +272,7 @@ static int load_config(void)
                else
                        ast_free(tableptr);
        }
+       ast_config_destroy(cfg);
        return res;
 }
 
index 0e5d855d31c9877dfaa05fe7152c99df7d29a345..b762094a96e3c81436ceace4626245e551961f35 100644 (file)
@@ -2286,6 +2286,7 @@ static int gtalk_load_config(void)
                cat = ast_category_browse(cfg, cat);
        }
 
+       ast_config_destroy(cfg);
        gtalk_update_externip();
        gtalk_free_candidates(global_candidates);
        return 1;
index 233ec7e2e5aaaef8944ca73635e5220c0127b15e..f202915fd6702b11141792cb8190ef1c0c3d106a 100644 (file)
@@ -1926,6 +1926,7 @@ static int jingle_load_config(void)
                }
                cat = ast_category_browse(cfg, cat);
        }
+       ast_config_destroy(cfg);
        jingle_free_candidates(global_candidates);
        return 1;
 }