From 49b90d5e61dd158e963cd5d623cbca50e8b4f1c8 Mon Sep 17 00:00:00 2001
From: Richard Mudgett <rmudgett@digium.com>
Date: Wed, 7 Oct 2009 21:56:36 +0000
Subject: [PATCH] Merged revisions 222691 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222691 | rmudgett | 2009-10-07 16:51:24 -0500 (Wed, 07 Oct 2009) | 14 lines

  chan_misdn.c:process_ast_dsp() memory leak

  misdn.conf: astdtmf must be set to "yes".  With "no", buffer loss does not
  occur.

  The translated frame "f2" when passing through ast_dsp_process() is not
  freed whenever it is not used further in process_ast_dsp().  Then in the
  end it is never ever freed.

  Patches:
        translate.patch

  JIRA ABE-1993
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 channels/chan_misdn.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index 4860ba0a78..6d0e3d89f7 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -6970,8 +6970,12 @@ static struct ast_frame *process_ast_dsp(struct chan_list *tmp, struct ast_frame
 		return NULL;
 	}
 
- 	if (!f || (f->frametype != AST_FRAME_DTMF))
- 		return frame;
+	if (!f || (f->frametype != AST_FRAME_DTMF)) {
+		if (f) {
+			ast_frfree(f);
+		}
+		return frame;
+	}
 
 	ast_debug(1, "Detected inband DTMF digit: %c\n", f->subclass);
 
-- 
GitLab