diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2007-06-03 06:10:27 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2007-06-03 06:10:27 +0000 |
commit | ce9ec91897d8ddf1b26e8bb67d3dee2d482730a3 (patch) | |
tree | 47467b33841bb4ba9ac822e234ee2cac2218aef4 /channels/chan_nbs.c | |
parent | b1490716f6adf54f7282322bbee7cb04de632f23 (diff) |
ast_calloc janitor (Inspired by issue 9860)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@66981 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_nbs.c')
-rw-r--r-- | channels/chan_nbs.c | 7 |
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 */ |