mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 23:08:32 +00:00
Handle allocation failure of the heard and deleted arrays of the vm_state.
(closes issue #11408, reported and patched by jaroth) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91579 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user