diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-12 20:39:21 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-05-12 20:39:21 +0000 |
commit | 919b7978d6e45988221f47a153eb2c6c64ea7348 (patch) | |
tree | 33318072fd16ad1f6b74d289f2109f234450641a /apps/app_voicemail.c | |
parent | ef998aeddaa8ab3ba449dbb1300666bb5c6d60ab (diff) |
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.4@193955 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_voicemail.c')
-rw-r--r-- | apps/app_voicemail.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index a1cdf386f..f3e423ec1 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -7441,6 +7441,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); @@ -7452,9 +7456,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)))) { /* TODO: Handle memory allocation failure */ } @@ -7869,7 +7870,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); |