Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2007-06-06 21:20:11 +00:00
parent 033a3df22a
commit 9d05ff8ed5
94 changed files with 2530 additions and 2701 deletions

View File

@@ -422,7 +422,7 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
if (oldargs[x]) {
if (!dead)
pbx_builtin_setvar_helper(chan, varname, oldargs[x]);
free(oldargs[x]);
ast_free(oldargs[x]);
} else if (!dead) {
pbx_builtin_setvar_helper(chan, varname, NULL);
}
@@ -435,11 +435,11 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
pbx_builtin_setvar_helper(chan, "MACRO_PRIORITY", save_macro_priority);
}
if (save_macro_exten)
free(save_macro_exten);
ast_free(save_macro_exten);
if (save_macro_context)
free(save_macro_context);
ast_free(save_macro_context);
if (save_macro_priority)
free(save_macro_priority);
ast_free(save_macro_priority);
if (!dead && setmacrocontext) {
chan->macrocontext[0] = '\0';
@@ -470,7 +470,7 @@ static int _macro_exec(struct ast_channel *chan, void *data, int exclusive)
if (!dead)
pbx_builtin_setvar_helper(chan, "MACRO_OFFSET", save_macro_offset);
if (save_macro_offset)
free(save_macro_offset);
ast_free(save_macro_offset);
/* Unlock the macro */
if (exclusive) {