[Asterisk-cvs] asterisk/apps app_voicemail.c,1.45,1.46

martinp at lists.digium.com martinp at lists.digium.com
Mon Dec 22 10:44:14 CST 2003


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv2418/apps

Modified Files:
	app_voicemail.c 
Log Message:
Don't free the user structure before reading the next pointer


Index: app_voicemail.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_voicemail.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -d -r1.45 -r1.46
--- app_voicemail.c	19 Dec 2003 18:06:28 -0000	1.45
+++ app_voicemail.c	22 Dec 2003 16:35:48 -0000	1.46
@@ -2166,7 +2166,7 @@
 	char fn[256];
 	char callerid[512];
 	int res = 0, cmd = 0;
-	struct ast_vm_user *receiver, *extensions = NULL, *vmtmp = NULL;
+	struct ast_vm_user *receiver, *extensions = NULL, *vmtmp = NULL, *vmfree;
 	char tmp[256];
 	char *stringp, *s;
 	int saved_messages = 0, found = 0;
@@ -2270,9 +2270,10 @@
 		/* Leave voicemail for someone */
 		manager_event(EVENT_FLAG_CALL, "MessageWaiting", "Mailbox: %s\r\nWaiting: %d\r\n", vmtmp->mailbox, ast_app_has_voicemail(vmtmp->mailbox));
 
-		free_user(vmtmp);
 		saved_messages++;
+		vmfree = vmtmp;
 		vmtmp = vmtmp->next;
+		free_user(vmfree);
 	}
 	if (saved_messages > 0) {
 		/* give confirmatopm that the message was saved */




More information about the svn-commits mailing list