[asterisk-commits] mmichelson: branch group/upenn r101013 - /team/group/upenn/apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 29 15:11:57 CST 2008


Author: mmichelson
Date: Tue Jan 29 15:11:56 2008
New Revision: 101013

URL: http://svn.digium.com/view/asterisk?view=rev&rev=101013
Log:
Backporting the fix for issue 11408 from trunk to the upenn branch

This fix handles a memory allocation failure for the vms heard and deleted arrays.


Modified:
    team/group/upenn/apps/app_voicemail.c

Modified: team/group/upenn/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/group/upenn/apps/app_voicemail.c?view=diff&rev=101013&r1=101012&r2=101013
==============================================================================
--- team/group/upenn/apps/app_voicemail.c (original)
+++ team/group/upenn/apps/app_voicemail.c Tue Jan 29 15:11:56 2008
@@ -6640,10 +6640,14 @@
 		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 */




More information about the asterisk-commits mailing list