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: https://origsvn.digium.com/svn/asterisk/branches/1.4@181133 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Jeff Peeler
2009-03-11 03:25:04 +00:00
parent 280153085e
commit 21ca773c28
10 changed files with 58 additions and 34 deletions

View File

@@ -4729,7 +4729,7 @@ static int sla_build_trunk(struct ast_config *cfg, const char *cat)
return -1;
}
if (ast_add_extension2(context, 0 /* don't replace */, "s", 1,
NULL, NULL, slatrunk_app, ast_strdup(trunk->name), ast_free, sla_registrar)) {
NULL, NULL, slatrunk_app, ast_strdup(trunk->name), ast_free_ptr, sla_registrar)) {
ast_log(LOG_ERROR, "Failed to automatically create extension "
"for trunk '%s'!\n", trunk->name);
destroy_trunk(trunk);
@@ -4868,7 +4868,7 @@ static int sla_build_station(struct ast_config *cfg, const char *cat)
/* The extension for when the handset goes off-hook.
* exten => station1,1,SLAStation(station1) */
if (ast_add_extension2(context, 0 /* don't replace */, station->name, 1,
NULL, NULL, slastation_app, ast_strdup(station->name), ast_free, sla_registrar)) {
NULL, NULL, slastation_app, ast_strdup(station->name), ast_free_ptr, sla_registrar)) {
ast_log(LOG_ERROR, "Failed to automatically create extension "
"for trunk '%s'!\n", station->name);
destroy_station(station);
@@ -4883,7 +4883,7 @@ static int sla_build_station(struct ast_config *cfg, const char *cat)
/* Extension for this line button
* exten => station1_line1,1,SLAStation(station1_line1) */
if (ast_add_extension2(context, 0 /* don't replace */, exten, 1,
NULL, NULL, slastation_app, ast_strdup(exten), ast_free, sla_registrar)) {
NULL, NULL, slastation_app, ast_strdup(exten), ast_free_ptr, sla_registrar)) {
ast_log(LOG_ERROR, "Failed to automatically create extension "
"for trunk '%s'!\n", station->name);
destroy_station(station);