[asterisk-commits] russell: branch 1.4 r80132 - /branches/1.4/channels/chan_mgcp.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 21 10:22:22 CDT 2007


Author: russell
Date: Tue Aug 21 10:22:22 2007
New Revision: 80132

URL: http://svn.digium.com/view/asterisk?view=rev&rev=80132
Log:
Don't try to dereference the owner channel when it may not exist
(issue #10507, maxper)

Modified:
    branches/1.4/channels/chan_mgcp.c

Modified: branches/1.4/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_mgcp.c?view=diff&rev=80132&r1=80131&r2=80132
==============================================================================
--- branches/1.4/channels/chan_mgcp.c (original)
+++ branches/1.4/channels/chan_mgcp.c Tue Aug 21 10:22:22 2007
@@ -3239,19 +3239,16 @@
 				(((ev[0] >= '0') && (ev[0] <= '9')) ||
 				 ((ev[0] >= 'A') && (ev[0] <= 'D')) ||
 				  (ev[0] == '*') || (ev[0] == '#'))) {
-			if (sub && (sub->owner->_state >=  AST_STATE_UP)) {
+			if (sub && sub->owner && (sub->owner->_state >=  AST_STATE_UP)) {
 				f.frametype = AST_FRAME_DTMF;
 				f.subclass = ev[0];
 				f.src = "mgcp";
-				if (sub->owner) {
-					/* XXX MUST queue this frame to all subs in threeway call if threeway call is active */
-					mgcp_queue_frame(sub, &f);
-					ast_mutex_lock(&sub->next->lock);
-					if (sub->next->owner) {
-						mgcp_queue_frame(sub->next, &f);
-					}
-					ast_mutex_unlock(&sub->next->lock);
-				}
+				/* XXX MUST queue this frame to all subs in threeway call if threeway call is active */
+				mgcp_queue_frame(sub, &f);
+				ast_mutex_lock(&sub->next->lock);
+				if (sub->next->owner)
+					mgcp_queue_frame(sub->next, &f);
+				ast_mutex_unlock(&sub->next->lock);
 				if (strstr(p->curtone, "wt") && (ev[0] == 'A')) {
 					memset(p->curtone, 0, sizeof(p->curtone));
 				}




More information about the asterisk-commits mailing list