From: Russell Bryant Date: Tue, 21 Aug 2007 15:22:22 +0000 (+0000) Subject: Don't try to dereference the owner channel when it may not exist X-Git-Tag: 1.4.12.1~221 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=db1f93048fa195cc5beb48ae20c16599cf063289;p=thirdparty%2Fasterisk.git Don't try to dereference the owner channel when it may not exist (issue #10507, maxper) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80132 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index bfcb3e8b44..d504e36797 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -3239,19 +3239,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)); }