From: Terry Wilson Date: Wed, 28 Mar 2012 19:20:04 +0000 (+0000) Subject: Destroy configs when they are no longer used X-Git-Tag: 10.3.0~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d10ae278e47772c6f17b6b523f4c1ad28363b2f7;p=thirdparty%2Fasterisk.git Destroy configs when they are no longer used 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 --- diff --git a/addons/cdr_mysql.c b/addons/cdr_mysql.c index ecdfaea0bd..445f9e3d05 100644 --- a/addons/cdr_mysql.c +++ b/addons/cdr_mysql.c @@ -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; } diff --git a/addons/chan_ooh323.c b/addons/chan_ooh323.c index d7a63bf809..1b7525ef9b 100644 --- a/addons/chan_ooh323.c +++ b/addons/chan_ooh323.c @@ -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; diff --git a/cdr/cdr_adaptive_odbc.c b/cdr/cdr_adaptive_odbc.c index c4ffa16c6b..0c4bb8a474 100644 --- a/cdr/cdr_adaptive_odbc.c +++ b/cdr/cdr_adaptive_odbc.c @@ -272,6 +272,7 @@ static int load_config(void) else ast_free(tableptr); } + ast_config_destroy(cfg); return res; } diff --git a/channels/chan_gtalk.c b/channels/chan_gtalk.c index 0e5d855d31..b762094a96 100644 --- a/channels/chan_gtalk.c +++ b/channels/chan_gtalk.c @@ -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; diff --git a/channels/chan_jingle.c b/channels/chan_jingle.c index 233ec7e2e5..f202915fd6 100644 --- a/channels/chan_jingle.c +++ b/channels/chan_jingle.c @@ -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; }