aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_chanspy.c
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-17 14:18:26 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-17 14:18:26 +0000
commit51c882f58c4747b9dd2c7113ed5d988adfe24968 (patch)
tree0d0ebd9adb28d1c497b3f7251ed7a0b1a4c96c2f /apps/app_chanspy.c
parentd2f21610b3a6dd0fd1002f62f535f52b57b1042f (diff)
Make sure that we release the lock on the spyee channel if the spyee or spy has hung up
(closes issue #12232) Reported by: atis git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@109012 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_chanspy.c')
-rw-r--r--apps/app_chanspy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c
index 41e658037..b97bfce71 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -250,8 +250,10 @@ static int channel_spy(struct ast_channel *chan, struct chanspy_ds *spyee_chansp
/* We now hold the channel lock on spyee */
- if (ast_check_hangup(chan) || ast_check_hangup(spyee))
+ if (ast_check_hangup(chan) || ast_check_hangup(spyee)) {
+ ast_channel_unlock(spyee);
return 0;
+ }
name = ast_strdupa(spyee->name);
if (option_verbose >= 2)