From: Automerge Script Date: Sat, 3 Mar 2007 07:05:14 +0000 (+0000) Subject: automerge commit X-Git-Tag: 1.2.17-netsec~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=224316634abd886cb2ca96c1436442bdeb00837e;p=thirdparty%2Fasterisk.git automerge commit git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@57690 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 993e4df137..98bb8b96e3 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -3626,6 +3626,7 @@ static int forward_message(struct ast_channel *chan, char *context, char *dir, i vmtmp = vmtmp->next; free_user(vmfree); } + extensions = NULL; if (saved_messages > 0) { /* give confirmation that the message was saved */ /* commented out since we can't forward batches yet @@ -3639,6 +3640,13 @@ static int forward_message(struct ast_channel *chan, char *context, char *dir, i } } } + + /* If anything failed above, we still have this list to free */ + while (extensions) { + vmfree = extensions; + extensions = extensions->next; + free_user(vmfree); + } return res ? res : cmd; }