From: Terry Wilson Date: Wed, 28 Mar 2012 19:06:03 +0000 (+0000) Subject: Destroy configs when they are no longer used X-Git-Tag: 1.8.11.0~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d58fe85724affa7639b50ba82805a803857ba409;p=thirdparty%2Fasterisk.git Destroy configs when they are no longer used https://reviewboard.asterisk.org/r/1834/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360712 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 b74542cb91..07c9cb7fed 100644 --- a/addons/chan_ooh323.c +++ b/addons/chan_ooh323.c @@ -2648,6 +2648,7 @@ int reload_config(int reload) pNewAlias = malloc(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 */ @@ -2662,6 +2663,7 @@ int reload_config(int reload) pNewAlias = malloc(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; @@ -2673,6 +2675,7 @@ int reload_config(int reload) pNewAlias = malloc(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 619d78155e..ac23ea0df5 100644 --- a/cdr/cdr_adaptive_odbc.c +++ b/cdr/cdr_adaptive_odbc.c @@ -263,6 +263,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 8cd50048c3..ff1ea6b771 100644 --- a/channels/chan_gtalk.c +++ b/channels/chan_gtalk.c @@ -2195,6 +2195,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 01fd3b57ed..56c89a361d 100644 --- a/channels/chan_jingle.c +++ b/channels/chan_jingle.c @@ -1888,6 +1888,7 @@ static int jingle_load_config(void) } cat = ast_category_browse(cfg, cat); } + ast_config_destroy(cfg); jingle_free_candidates(global_candidates); return 1; }