[asterisk-commits] tilghman: branch 1.4 r193955 - /branches/1.4/apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 12 15:39:26 CDT 2009


Author: tilghman
Date: Tue May 12 15:39:21 2009
New Revision: 193955

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=193955
Log:
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)

Modified:
    branches/1.4/apps/app_voicemail.c

Modified: branches/1.4/apps/app_voicemail.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/apps/app_voicemail.c?view=diff&rev=193955&r1=193954&r2=193955
==============================================================================
--- branches/1.4/apps/app_voicemail.c (original)
+++ branches/1.4/apps/app_voicemail.c Tue May 12 15:39:21 2009
@@ -7441,6 +7441,10 @@
 	/* 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 @@
 	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 @@
 	}
 	/*  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);




More information about the asterisk-commits mailing list