summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2012-03-14 22:38:29 +0000
committerRichard Mudgett <rmudgett@digium.com>2012-03-14 22:38:29 +0000
commit9b31bd3cd83b50e0843f42b70d5e111287fa8107 (patch)
tree6f9fad87dcbdc947019dd82f930bb310f9df688a /channels
parenta699bb72ad8d255c84998e97addd2e20ab3f6b7b (diff)
Fix deadlock potential with some ast_indicate/ast_indicate_data calls.
Calling ast_indicate()/ast_indicate_data() with the channel lock held can result in a deadlock with a local channel because of how local channels need to avoid deadlock. ........ Merged revisions 359451 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 359453 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359455 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_agent.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index 0c79a66de..01938396d 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -967,9 +967,7 @@ static int agent_hangup(struct ast_channel *ast)
ast_channel_internal_bridged_channel_set(p->chan, NULL);
/* If they're dead, go ahead and hang up on the agent now */
if (p->dead) {
- ast_channel_lock(p->chan);
ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);
- ast_channel_unlock(p->chan);
} else if (p->loginstart) {
indicate_chan = ast_channel_ref(p->chan);
tmp_moh = ast_strdupa(p->moh);
@@ -978,11 +976,9 @@ static int agent_hangup(struct ast_channel *ast)
ast_mutex_unlock(&p->lock);
if (indicate_chan) {
- ast_channel_lock(indicate_chan);
ast_indicate_data(indicate_chan, AST_CONTROL_HOLD,
S_OR(tmp_moh, NULL),
!ast_strlen_zero(tmp_moh) ? strlen(tmp_moh) + 1 : 0);
- ast_channel_unlock(indicate_chan);
indicate_chan = ast_channel_unref(indicate_chan);
}