summaryrefslogtreecommitdiff
path: root/apps/app_chanspy.c
diff options
context:
space:
mode:
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 32d5e7c0b..ab056e0aa 100644
--- a/apps/app_chanspy.c
+++ b/apps/app_chanspy.c
@@ -275,8 +275,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);
ast_verb(2, "Spying on channel %s\n", name);