From eb5d461ed4688cafadc76bebf329a2fae454dc12 Mon Sep 17 00:00:00 2001 From: tilghman Date: Wed, 6 Jun 2007 21:20:11 +0000 Subject: 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 --- main/app.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'main/app.c') diff --git a/main/app.c b/main/app.c index 32e36e9df..b3fd264f1 100644 --- a/main/app.c +++ b/main/app.c @@ -306,7 +306,7 @@ static void linear_release(struct ast_channel *chan, void *params) } if (ls->autoclose) close(ls->fd); - free(params); + ast_free(params); } static int linear_generator(struct ast_channel *chan, void *data, int len, int samples) @@ -349,7 +349,7 @@ static void *linear_alloc(struct ast_channel *chan, void *params) ls->origwfmt = chan->writeformat; if (ast_set_write_format(chan, AST_FORMAT_SLINEAR)) { ast_log(LOG_WARNING, "Unable to set '%s' to linear format (write)\n", chan->name); - free(ls); + ast_free(ls); ls = params = NULL; } } @@ -844,7 +844,7 @@ int ast_app_group_set_channel(struct ast_channel *chan, const char *data) break; } - if (!gi && (gi = calloc(1, len))) { + if (!gi && (gi = ast_calloc(1, len))) { gi->chan = chan; gi->group = (char *) gi + sizeof(*gi); strcpy(gi->group, group); @@ -927,7 +927,7 @@ int ast_app_group_discard(struct ast_channel *chan) AST_LIST_TRAVERSE_SAFE_BEGIN(&groups, gi, list) { if (gi->chan == chan) { AST_LIST_REMOVE_CURRENT(&groups, list); - free(gi); + ast_free(gi); } } AST_LIST_TRAVERSE_SAFE_END @@ -1378,7 +1378,7 @@ char *ast_read_textfile(const char *filename) output[res] = '\0'; } else { ast_log(LOG_WARNING, "Short read of %s (%d of %d): %s\n", filename, res, count - 1, strerror(errno)); - free(output); + ast_free(output); output = NULL; } } -- cgit v1.2.3