aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authormartinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b>2003-12-22 16:35:48 +0000
committermartinp <martinp@f38db490-d61c-443f-a65b-d21fe96a405b>2003-12-22 16:35:48 +0000
commite08307e5ee251529759e5b6e0465e6576d8a7018 (patch)
tree4c9900817e7d3a7576bd5027309c075fcf4a895f /apps
parentfc290b7c748594f7a79da72423258b4ca402f812 (diff)
Don't free the user structure before reading the next pointer
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1874 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_voicemail.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index ced94c639..68b815467 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -2166,7 +2166,7 @@ static int forward_message(struct ast_channel *chan, char *context, char *dir, i
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 @@ static int forward_message(struct ast_channel *chan, char *context, char *dir, i
/* 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 */