diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-06 21:03:15 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-12-06 21:03:15 +0000 |
commit | df690ef26fb3103275284066e59e47ae837ad195 (patch) | |
tree | c960f59ba544f47551e660225369af89fc1b077d /apps/app_voicemail.c | |
parent | ee6901bb3c10c917243d0b4a3055d928d9818829 (diff) |
Handle allocation failure of the heard and deleted arrays of the vm_state.
(closes issue #11408, reported and patched by jaroth)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@91579 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r-- | apps/app_voicemail.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 774272e2b..259c55e91 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -6947,10 +6947,14 @@ static int vm_execmain(struct ast_channel *chan, void *data) goto out; if (!(vms.deleted = ast_calloc(vmu->maxmsg, sizeof(int)))) { - /* TODO: Handle memory allocation failure */ + ast_log(LOG_ERROR, "Could not allocate memory for deleted message storage!\n"); + cmd = ast_play_and_wait(chan, "an-error-has-occured"); + return -1; } if (!(vms.heard = ast_calloc(vmu->maxmsg, sizeof(int)))) { - /* TODO: Handle memory allocation failure */ + ast_log(LOG_ERROR, "Could not allocate memory for heard message storage!\n"); + cmd = ast_play_and_wait(chan, "an-error-has-occured"); + return -1; } /* Set language from config to override channel language */ |