[asterisk-commits] file: trunk r47752 - in /trunk: ./ channels/chan_local.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Nov 16 11:32:27 MST 2006


Author: file
Date: Thu Nov 16 12:32:27 2006
New Revision: 47752

URL: http://svn.digium.com/view/asterisk?view=rev&rev=47752
Log:
Merged revisions 47751 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r47751 | file | 2006-11-16 13:29:12 -0500 (Thu, 16 Nov 2006) | 10 lines

Merged revisions 47750 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r47750 | file | 2006-11-16 13:26:50 -0500 (Thu, 16 Nov 2006) | 2 lines

Because of the way chan_local is written we should be extra careful and make sure our callback functions have a tech_pvt. (issue #8275 reported by mflorell)

........

................

Modified:
    trunk/   (props changed)
    trunk/channels/chan_local.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_local.c?view=diff&rev=47752&r1=47751&r2=47752
==============================================================================
--- trunk/channels/chan_local.c (original)
+++ trunk/channels/chan_local.c Thu Nov 16 12:32:27 2006
@@ -202,6 +202,9 @@
 	struct local_pvt *p = ast->tech_pvt;
 	int isoutbound;
 	int res = -1;
+
+	if (!p)
+		return -1;
 
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
@@ -276,6 +279,9 @@
 	int res = -1;
 	int isoutbound;
 
+	if (!p)
+		return -1;
+
 	/* Just queue for delivery to the other side */
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
@@ -320,6 +326,9 @@
 	int res = 0;
 	struct ast_frame f = { AST_FRAME_CONTROL, };
 	int isoutbound;
+
+	if (!p)
+		return -1;
 
 	/* If this is an MOH hold or unhold, do it on the Local channel versus real channel */
 	if (condition == AST_CONTROL_HOLD) {
@@ -347,6 +356,9 @@
 	struct ast_frame f = { AST_FRAME_DTMF_BEGIN, };
 	int isoutbound;
 
+	if (!p)
+		return -1;
+
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
 	f.subclass = digit;
@@ -363,6 +375,9 @@
 	struct ast_frame f = { AST_FRAME_DTMF_END, };
 	int isoutbound;
 
+	if (!p)
+		return -1;
+
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
 	f.subclass = digit;
@@ -378,6 +393,9 @@
 	int res = -1;
 	struct ast_frame f = { AST_FRAME_TEXT, };
 	int isoutbound;
+
+	if (!p)
+		return -1;
 
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
@@ -395,6 +413,9 @@
 	struct ast_frame f = { AST_FRAME_HTML, };
 	int isoutbound;
 
+	if (!p)
+		return -1;
+	
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
 	f.subclass = subclass;
@@ -413,6 +434,9 @@
 	int res;
 	struct ast_var_t *varptr = NULL, *new;
 	size_t len, namelen;
+
+	if (!p)
+		return -1;
 	
 	ast_mutex_lock(&p->lock);
 
@@ -453,6 +477,9 @@
 	struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP };
 	struct ast_channel *ochan = NULL;
 	int glaredetect = 0;
+
+	if (!p)
+		return -1;
 
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);



More information about the asterisk-commits mailing list