From: Joshua Colp Date: Mon, 14 Apr 2008 15:36:02 +0000 (+0000) Subject: During hangup it is possible for p->chan or p->owner to be NULL, so just return what... X-Git-Tag: 1.6.2.0-beta1~2485 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6fad8249f55683f22fe50bfd87ef56ad69fb92c1;p=thirdparty%2Fasterisk.git During hangup it is possible for p->chan or p->owner to be NULL, so just return what the channel is bridged to instead of what they are *really* bridged to. Thanks Matt Nicholson! git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114109 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_local.c b/channels/chan_local.c index e79c82184d..d371a0f759 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -183,8 +183,11 @@ static struct ast_channel *local_bridgedchannel(struct ast_channel *chan, struct bridged = (bridge == p->owner ? p->chan : p->owner); /* Now see if the opposite channel is bridged to anything */ - if (bridged->_bridge) + if (!bridged) { + bridged = bridge; + } else if (bridged->_bridge) { bridged = bridged->_bridge; + } } ast_mutex_unlock(&p->lock);