aboutsummaryrefslogtreecommitdiffstats
path: root/channel.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-06 05:27:14 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-06-06 05:27:14 +0000
commita4ab9fc8c2ec2e80f0a91ec4f53aea0c0a8c04ee (patch)
treef6cf66d34977686b8df0da552dd004f678246218 /channel.c
parentd3391c2a91ccac5fc084e13f8e10675b58c446ba (diff)
fix a channel deadlock in ast_answer
(deadlock reported by and debuged with hads on #asterisk-dev on IRC) (probably fixes issue #7267, maybe others) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32478 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channel.c')
-rw-r--r--channel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/channel.c b/channel.c
index e8f309eb1..214a79c4e 100644
--- a/channel.c
+++ b/channel.c
@@ -1502,8 +1502,10 @@ int ast_answer(struct ast_channel *chan)
int res = 0;
ast_channel_lock(chan);
/* You can't answer an outbound call */
- if (ast_test_flag(chan, AST_FLAG_OUTGOING))
+ if (ast_test_flag(chan, AST_FLAG_OUTGOING)) {
+ ast_channel_unlock(chan);
return 0;
+ }
/* Stop if we're a zombie or need a soft hangup */
if (ast_test_flag(chan, AST_FLAG_ZOMBIE) || ast_check_hangup(chan)) {
ast_channel_unlock(chan);