diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c index 518b9e9277..edf5d454bd 100644 --- a/apps/app_voicemail.c +++ b/apps/app_voicemail.c @@ -4163,6 +4163,10 @@ static int forward_message(struct ast_channel *chan, char *context, struct vm_st } } } + + /* If anything failed above, we still have this list to free */ + while ((vmtmp = AST_LIST_REMOVE_HEAD(&extensions, list))) + free_user(vmtmp); return res ? res : cmd; }