diff options
author | bweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-13 03:34:31 +0000 |
---|---|---|
committer | bweschke <bweschke@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-01-13 03:34:31 +0000 |
commit | 589c3c0044b532cde995c7339a04714128a61d73 (patch) | |
tree | 4c1811d4204404d6e76227a772b535cb8ad0c154 /apps/app_festival.c | |
parent | bb26a9138e13c01ab7fba613854fabb788341d45 (diff) |
More memory wrapper cleanup. #6224
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8045 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_festival.c')
-rw-r--r-- | apps/app_festival.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/apps/app_festival.c b/apps/app_festival.c index 799272778..b6503facb 100644 --- a/apps/app_festival.c +++ b/apps/app_festival.c @@ -86,7 +86,10 @@ static char *socket_receive_file_to_buff(int fd,int *size) char c; bufflen = 1024; - buff = (char *)malloc(bufflen); + if (!(buff = ast_malloc(bufflen))) + { + /* TODO: Handle memory allocation failure */ + } *size=0; for (k=0; file_stuff_key[k] != '\0';) @@ -96,7 +99,10 @@ static char *socket_receive_file_to_buff(int fd,int *size) if ((*size)+k+1 >= bufflen) { /* +1 so you can add a NULL if you want */ bufflen += bufflen/4; - buff = (char *)realloc(buff,bufflen); + if (!(buff = ast_realloc(buff, bufflen))) + { + /* TODO: Handle memory allocation failure */ + } } if (file_stuff_key[k] == c) k++; |