aboutsummaryrefslogtreecommitdiffstats
path: root/main/app.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/app.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/app.c')
-rw-r--r--main/app.c10
1 files changed, 5 insertions, 5 deletions
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;
}
}