aboutsummaryrefslogtreecommitdiffstats
path: root/main/asterisk.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-06 21:20:11 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-06 21:20:11 +0000
commiteb5d461ed4688cafadc76bebf329a2fae454dc12 (patch)
tree5503cb153c9de46c07e3a0a521cc996926ed375b /main/asterisk.c
parent125558c76fd4870a9133e4974cce6410c89a3593 (diff)
Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@67864 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/asterisk.c')
-rw-r--r--main/asterisk.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index 18a121339..48a90ae82 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -294,7 +294,7 @@ void ast_unregister_file_version(const char *file)
AST_LIST_TRAVERSE_SAFE_END;
AST_LIST_UNLOCK(&file_versions);
if (find)
- free(find);
+ ast_free(find);
}
struct thread_list_t {
@@ -336,8 +336,8 @@ void ast_unregister_thread(void *id)
AST_LIST_TRAVERSE_SAFE_END;
AST_LIST_UNLOCK(&thread_list);
if (x) {
- free(x->name);
- free(x);
+ ast_free(x->name);
+ ast_free(x);
}
}
@@ -2036,7 +2036,7 @@ static int ast_cli_display_match_list(char **matches, int len, int max)
/* Don't print dupes */
if ( (matches[idx+1] != NULL && strcmp(matches[idx], matches[idx+1]) == 0 ) ) {
i--;
- free(matches[idx]);
+ ast_free(matches[idx]);
matches[idx] = NULL;
continue;
}
@@ -2044,7 +2044,7 @@ static int ast_cli_display_match_list(char **matches, int len, int max)
numoutput++;
numoutputline++;
fprintf(stdout, "%-*s ", max, matches[idx]);
- free(matches[idx]);
+ ast_free(matches[idx]);
matches[idx] = NULL;
}
if (numoutputline > 0)
@@ -2113,7 +2113,7 @@ static char *cli_complete(EditLine *el, int ch)
mbuf[mlen] = '\0';
matches = ast_el_strtoarr(mbuf);
- free(mbuf);
+ ast_free(mbuf);
} else
matches = (char **) NULL;
} else {
@@ -2159,8 +2159,8 @@ static char *cli_complete(EditLine *el, int ch)
}
}
for (i = 0; matches[i]; i++)
- free(matches[i]);
- free(matches);
+ ast_free(matches[i]);
+ ast_free(matches);
}
return (char *)(long)retval;