diff options
author | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-03-11 03:25:04 +0000 |
---|---|---|
committer | jpeeler <jpeeler@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-03-11 03:25:04 +0000 |
commit | d16c3fd4ca7637d33efa163106630a4110f7a448 (patch) | |
tree | 0cd32982e8825620c5d5bf61f85e3830118f357f /pbx/pbx_config.c | |
parent | 8e1667bc2d6b310744333ee2e30fd331fd66c70d (diff) |
Fix malloc debug macros to work properly with h323.
The main problem here was that cstdlib was undefining free thereby causing the
proper debug macros to not be used. ast_h323.cxx has been changed to call
ast_free instead to avoid the issue. Because using the ast prefix calls are
a better choice, ast_free_ptr is the new wrapper for free to pass to functions.
Also, a little bit of clean up was done to avoid the debug macros intentionally
being redefined.
(closes issue #13593)
Reported by: pj
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@181133 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/pbx_config.c')
-rw-r--r-- | pbx/pbx_config.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index ad3c86abe..c99c2983b 100644 --- a/pbx/pbx_config.c +++ b/pbx/pbx_config.c @@ -1536,7 +1536,7 @@ static int handle_context_add_extension_deprecated(int fd, int argc, char *argv[ if (!app_data) app_data=""; if (ast_add_extension(argv[4], argc == 6 ? 1 : 0, exten, iprior, NULL, cidmatch, app, - (void *)strdup(app_data), ast_free, registrar)) { + (void *)strdup(app_data), ast_free_ptr, registrar)) { switch (errno) { case ENOMEM: ast_cli(fd, "Out of free memory\n"); @@ -1629,7 +1629,7 @@ static int handle_context_add_extension(int fd, int argc, char *argv[]) if (!app_data) app_data=""; if (ast_add_extension(argv[5], argc == 7 ? 1 : 0, exten, iprior, NULL, cidmatch, app, - (void *)strdup(app_data), ast_free, registrar)) { + (void *)strdup(app_data), ast_free_ptr, registrar)) { switch (errno) { case ENOMEM: ast_cli(fd, "Out of free memory\n"); @@ -2372,7 +2372,7 @@ static int pbx_load_config(const char *config_file) lastpri = ipri; if (!ast_opt_dont_warn && !strcmp(realext, "_.")) ast_log(LOG_WARNING, "The use of '_.' for an extension is strongly discouraged and can have unexpected behavior. Please use '_X.' instead at line %d\n", v->lineno); - if (ast_add_extension2(con, 0, realext, ipri, label, cidmatch, appl, strdup(data), ast_free, registrar)) { + if (ast_add_extension2(con, 0, realext, ipri, label, cidmatch, appl, strdup(data), ast_free_ptr, registrar)) { ast_log(LOG_WARNING, "Unable to register extension at line %d\n", v->lineno); } } @@ -2516,9 +2516,9 @@ static void pbx_load_users(void) /* If voicemail, use "stdexten" else use plain old dial */ if (hasvoicemail) { snprintf(tmp, sizeof(tmp), "stdexten|%s|${HINT}", cat); - ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Macro", strdup(tmp), ast_free, registrar); + ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Macro", strdup(tmp), ast_free_ptr, registrar); } else { - ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Dial", strdup("${HINT}"), ast_free, registrar); + ast_add_extension2(con, 0, cat, 1, NULL, NULL, "Dial", strdup("${HINT}"), ast_free_ptr, registrar); } } } |