From fe145669ee3357bd74e533e6d0336d52888a9ce0 Mon Sep 17 00:00:00 2001 From: russell Date: Tue, 21 Aug 2007 15:23:12 +0000 Subject: Merged revisions 80132 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r80132 | russell | 2007-08-21 10:22:22 -0500 (Tue, 21 Aug 2007) | 3 lines Don't try to dereference the owner channel when it may not exist (issue #10507, maxper) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80133 f38db490-d61c-443f-a65b-d21fe96a405b --- channels/chan_mgcp.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'channels/chan_mgcp.c') diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index c4229e0a1..c4306e3be 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -3200,19 +3200,16 @@ static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req, (((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)); } -- cgit v1.2.3