aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_nbs.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-03 06:10:27 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2007-06-03 06:10:27 +0000
commit017773401f29b879f48ca952ce963dc41259618c (patch)
tree47467b33841bb4ba9ac822e234ee2cac2218aef4 /channels/chan_nbs.c
parent9895f3dbd288aaa18d4a11c95af58cee61f27325 (diff)
ast_calloc janitor (Inspired by issue 9860)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@66981 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_nbs.c')
-rw-r--r--channels/chan_nbs.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/channels/chan_nbs.c b/channels/chan_nbs.c
index 2cb912e54..3fb606f5a 100644
--- a/channels/chan_nbs.c
+++ b/channels/chan_nbs.c
@@ -122,7 +122,7 @@ static void nbs_destroy(struct nbs_pvt *p)
if (p->nbs)
nbs_delstream(p->nbs);
ast_module_user_remove(p->u);
- free(p);
+ ast_free(p);
}
static struct nbs_pvt *nbs_alloc(void *data)
@@ -138,9 +138,8 @@ static struct nbs_pvt *nbs_alloc(void *data)
opts++;
} else
opts = "";
- p = malloc(sizeof(struct nbs_pvt));
+ p = ast_calloc(1, sizeof(*p));
if (p) {
- memset(p, 0, sizeof(struct nbs_pvt));
if (!ast_strlen_zero(opts)) {
if (strchr(opts, 'm'))
flags |= NBS_FLAG_MUTE;
@@ -157,7 +156,7 @@ static struct nbs_pvt *nbs_alloc(void *data)
p->nbs = nbs_newstream("asterisk", stream, flags);
if (!p->nbs) {
ast_log(LOG_WARNING, "Unable to allocate new NBS stream '%s' with flags %d\n", stream, flags);
- free(p);
+ ast_free(p);
p = NULL;
} else {
/* Set for 8000 hz mono, 640 samples */