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

@@ -378,7 +378,7 @@ static int agent_cleanup(struct agent_pvt *p)
if (p->dead) {
ast_mutex_destroy(&p->lock);
ast_mutex_destroy(&p->app_lock);
free(p);
ast_free(p);
}
return 0;
}
@@ -810,7 +810,7 @@ static int agent_hangup(struct ast_channel *ast)
} else if (p->dead) {
ast_mutex_destroy(&p->lock);
ast_mutex_destroy(&p->app_lock);
free(p);
ast_free(p);
} else {
if (p->chan) {
/* Not dead -- check availability now */
@@ -1136,7 +1136,7 @@ static int read_agent_config(void)
if (!p->chan) {
ast_mutex_destroy(&p->lock);
ast_mutex_destroy(&p->app_lock);
free(p);
ast_free(p);
} else {
/* Cause them to hang up */
ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
@@ -2118,7 +2118,7 @@ static int __login_exec(struct ast_channel *chan, void *data, int callbackmode)
if (p->dead && !p->owner) {
ast_mutex_destroy(&p->lock);
ast_mutex_destroy(&p->app_lock);
free(p);
ast_free(p);
}
}
else {
@@ -2531,7 +2531,7 @@ static int unload_module(void)
while ((p = AST_LIST_REMOVE_HEAD(&agents, list))) {
if (p->owner)
ast_softhangup(p->owner, AST_SOFTHANGUP_APPUNLOAD);
free(p);
ast_free(p);
}
AST_LIST_UNLOCK(&agents);
AST_LIST_HEAD_DESTROY(&agents);