]> 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:06:03 +0000 (19:06 +0000)
committerTerry Wilson <twilson@digium.com>
Wed, 28 Mar 2012 19:06:03 +0000 (19:06 +0000)
https://reviewboard.asterisk.org/r/1834/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@360712 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 b74542cb9137fa5335f0ebb0111d3f0dbb700b9e..07c9cb7fed079f4d9fe6de29d32d45135ff5de76 100644 (file)
@@ -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;
index 619d78155e5eabcadd60df981d47ca1439be5135..ac23ea0df5405e2a41b799d16b5468122d5391da 100644 (file)
@@ -263,6 +263,7 @@ static int load_config(void)
                else
                        ast_free(tableptr);
        }
+       ast_config_destroy(cfg);
        return res;
 }
 
index 8cd50048c36178f5db8174fb0c11a945d0f8a8cb..ff1ea6b771fc1084adcee5ad7af1d7ebc9d2e728 100644 (file)
@@ -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;
index 01fd3b57ed6e901047c4d6b04840a1c2a8e3c5e0..56c89a361d8e31c427838cba01b746f88ce8da31 100644 (file)
@@ -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;
 }