From 64a9c28c3bf1f2d731b60ffb3a9bb9f9cf4d04a5 Mon Sep 17 00:00:00 2001
From: Luigi Rizzo <rizzo@icir.org>
Date: Tue, 21 Nov 2006 11:07:30 +0000
Subject: [PATCH] do not ast_hangup() on a NULL channel. In the original code
 this would happen in the case of 	o->forwards >=  AST_MAX_FORWARDS

Likely an 1.2/1.4 isse as well - please someone have a look,
while I am hunting a few more similar panics now.



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

diff --git a/apps/app_dial.c b/apps/app_dial.c
index c3cc262432..6c1501b635 100644
--- a/apps/app_dial.c
+++ b/apps/app_dial.c
@@ -505,9 +505,9 @@ static void do_forward(struct dial_localuser *o,
 				ast_set_callerid(c, S_OR(in->macroexten, in->exten), get_cid_name(cidname, sizeof(cidname), in), NULL);
 			}
 		}
+		/* Hangup the original channel now, in case we needed it */
+		ast_hangup(c);
 	}
-	/* Hangup the original channel now, in case we needed it */
-	ast_hangup(c);
 }
 
 /* argument used for some functions. */
-- 
GitLab