diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-21 08:45:39 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-21 08:45:39 +0000 |
commit | 52fb5814943bd6d7d314d8f88dbd71b2c8d61c24 (patch) | |
tree | 63ee48c5830529cb1e1026badc6d3695fea22919 /codecs/codec_alaw.c | |
parent | 41cb10c7565fb6d43d5d0c705f422d99d7d152ff (diff) |
conversions to use allocation wrappers (issue #6277)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8381 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/codec_alaw.c')
-rw-r--r-- | codecs/codec_alaw.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/codecs/codec_alaw.c b/codecs/codec_alaw.c index 1c44d3434..a56e42a02 100644 --- a/codecs/codec_alaw.c +++ b/codecs/codec_alaw.c @@ -42,6 +42,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/translate.h" #include "asterisk/channel.h" #include "asterisk/alaw.h" +#include "asterisk/utils.h" #define BUFFER_SIZE 8096 /* size for the translation buffers */ @@ -94,14 +95,14 @@ struct alaw_decoder_pvt static struct ast_translator_pvt *alawtolin_new(void) { struct alaw_decoder_pvt *tmp; - tmp = malloc(sizeof(struct alaw_decoder_pvt)); - if (tmp) { - memset(tmp, 0, sizeof(*tmp)); + + if ((tmp = ast_calloc(1, sizeof(*tmp)))) { tmp->tail = 0; plc_init(&tmp->plc); localusecnt++; ast_update_use_count(); } + return (struct ast_translator_pvt *)tmp; } @@ -119,13 +120,13 @@ static struct ast_translator_pvt *alawtolin_new(void) static struct ast_translator_pvt *lintoalaw_new(void) { struct alaw_encoder_pvt *tmp; - tmp = malloc(sizeof(struct alaw_encoder_pvt)); - if (tmp) { - memset(tmp, 0, sizeof(*tmp)); + + if ((tmp = ast_calloc(1, sizeof(*tmp)))) { localusecnt++; ast_update_use_count(); tmp->tail = 0; } + return (struct ast_translator_pvt *)tmp; } |