From e62e4e376009e346edf92cffff0e5d7d3cc325de Mon Sep 17 00:00:00 2001 From: tilghman Date: Sat, 3 Mar 2007 06:36:55 +0000 Subject: Memory leak of a list, if call recording was abandoned git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@57648 f38db490-d61c-443f-a65b-d21fe96a405b --- apps/app_voicemail.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apps/app_voicemail.c') diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 993e4df13..98bb8b96e 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; } -- cgit v1.2.3