aboutsummaryrefslogtreecommitdiffstats
path: root/channels/iax2-provision.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 /channels/iax2-provision.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 'channels/iax2-provision.c')
-rw-r--r--channels/iax2-provision.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/channels/iax2-provision.c b/channels/iax2-provision.c
index 5a484fda5..31016b2ad 100644
--- a/channels/iax2-provision.c
+++ b/channels/iax2-provision.c
@@ -376,13 +376,12 @@ static int iax_process_template(struct ast_config *cfg, char *s, char *def)
}
if (!cur) {
mallocd = 1;
- cur = malloc(sizeof(struct iax_template));
+ cur = ast_calloc(1, sizeof(*cur));
if (!cur) {
ast_log(LOG_WARNING, "Out of memory!\n");
return -1;
}
/* Initialize entry */
- memset(cur, 0, sizeof(*cur));
strncpy(cur->name, s, sizeof(cur->name) - 1);
cur->dead = 1;
}
@@ -527,7 +526,7 @@ int iax_provision_reload(void)
prev->next = next;
else
templates = next;
- free(cur);
+ ast_free(cur);
} else
prev = cur;
cur = next;