diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2007-06-06 21:20:11 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2007-06-06 21:20:11 +0000 |
commit | 9d05ff8ed5f2c898370896ff7a8bb67885596ba1 (patch) | |
tree | 5503cb153c9de46c07e3a0a521cc996926ed375b /channels/iax2-provision.c | |
parent | 033a3df22aa68f04327066e0567b76f73c437651 (diff) |
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
Diffstat (limited to 'channels/iax2-provision.c')
-rw-r--r-- | channels/iax2-provision.c | 5 |
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; |