aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-12 20:42:17 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-05-12 20:42:17 +0000
commit9d2f494362682b5b0d91e4363c03173de23617cb (patch)
treedff0412c2ab88d882a79f9d67131fcf37d9c3def
parent8f68e5b559bd0020d5a8eb40fe649f36990e6c19 (diff)
Merged revisions 193956 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r193956 | tilghman | 2009-05-12 15:40:22 -0500 (Tue, 12 May 2009) | 13 lines Merged revisions 193955 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r193955 | tilghman | 2009-05-12 15:39:21 -0500 (Tue, 12 May 2009) | 6 lines Avoid initializing routines if the authentication fails. Fixes a crash (RR) issue. (closes issue #14508) Reported by: tiziano Patches: 20090221_2_wrongmailbox.diff.txt uploaded by tiziano (license 377) ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@193958 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_voicemail.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 4d62c658f..286530a06 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -8893,6 +8893,10 @@ static int vm_execmain(struct ast_channel *chan, void *data)
/* If ADSI is supported, setup login screen */
adsi_begin(chan, &useadsi);
+ if (!valid) {
+ goto out;
+ }
+
#ifdef IMAP_STORAGE
pthread_once(&ts_vmstate.once, ts_vmstate.key_init);
pthread_setspecific(ts_vmstate.key, &vms);
@@ -8904,9 +8908,6 @@ static int vm_execmain(struct ast_channel *chan, void *data)
vmstate_insert(&vms);
init_vm_state(&vms);
#endif
- if (!valid)
- goto out;
-
if (!(vms.deleted = ast_calloc(vmu->maxmsg, sizeof(int)))) {
ast_log(AST_LOG_ERROR, "Could not allocate memory for deleted message storage!\n");
cmd = ast_play_and_wait(chan, "an-error-has-occured");
@@ -9458,7 +9459,9 @@ out:
}
/* before we delete the state, we should copy pertinent info
* back to the persistent model */
- vmstate_delete(&vms);
+ if (vmu) {
+ vmstate_delete(&vms);
+ }
#endif
if (vmu)
free_user(vmu);