summaryrefslogtreecommitdiff
path: root/codecs/codec_ulaw.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2006-01-21 08:45:39 +0000
committerRussell Bryant <russell@russellbryant.com>2006-01-21 08:45:39 +0000
commitfbdc8ce317eacca50018748cb850ef317964af21 (patch)
tree63ee48c5830529cb1e1026badc6d3695fea22919 /codecs/codec_ulaw.c
parent24999261956367679ceaca57d626a113ebaecfc5 (diff)
conversions to use allocation wrappers (issue #6277)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'codecs/codec_ulaw.c')
-rw-r--r--codecs/codec_ulaw.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/codecs/codec_ulaw.c b/codecs/codec_ulaw.c
index 236d07d93..38332019c 100644
--- a/codecs/codec_ulaw.c
+++ b/codecs/codec_ulaw.c
@@ -42,6 +42,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/translate.h"
#include "asterisk/channel.h"
#include "asterisk/ulaw.h"
+#include "asterisk/utils.h"
#define BUFFER_SIZE 8096 /* size for the translation buffers */
@@ -96,14 +97,14 @@ struct ulaw_decoder_pvt
static struct ast_translator_pvt *ulawtolin_new(void)
{
struct ulaw_decoder_pvt *tmp;
- tmp = malloc(sizeof(struct ulaw_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;
}
@@ -121,13 +122,13 @@ static struct ast_translator_pvt *ulawtolin_new(void)
static struct ast_translator_pvt *lintoulaw_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)))) {
localusecnt++;
ast_update_use_count();
tmp->tail = 0;
}
+
return (struct ast_translator_pvt *)tmp;
}