From 52fb5814943bd6d7d314d8f88dbd71b2c8d61c24 Mon Sep 17 00:00:00 2001 From: russell Date: Sat, 21 Jan 2006 08:45:39 +0000 Subject: conversions to use allocation wrappers (issue #6277) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8381 f38db490-d61c-443f-a65b-d21fe96a405b --- codecs/codec_a_mu.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'codecs/codec_a_mu.c') diff --git a/codecs/codec_a_mu.c b/codecs/codec_a_mu.c index 47644a735..c21b26c95 100644 --- a/codecs/codec_a_mu.c +++ b/codecs/codec_a_mu.c @@ -41,6 +41,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "asterisk/channel.h" #include "asterisk/alaw.h" #include "asterisk/ulaw.h" +#include "asterisk/utils.h" #define BUFFER_SIZE 8096 /* size for the translation buffers */ @@ -83,26 +84,26 @@ struct ulaw_encoder_pvt static struct ast_translator_pvt *alawtoulaw_new(void) { struct ulaw_encoder_pvt *tmp; - tmp = malloc(sizeof(struct ulaw_encoder_pvt)); - if (tmp) { - memset(tmp, 0, sizeof(*tmp)); + + if ((tmp = ast_calloc(1, sizeof(*tmp)))) { tmp->tail = 0; localusecnt++; ast_update_use_count(); } + return (struct ast_translator_pvt *)tmp; } static struct ast_translator_pvt *ulawtoalaw_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; } -- cgit v1.2.3