From 284f74997d9a5d34bb25260fee03557d87d436fb Mon Sep 17 00:00:00 2001 From: Mark Michelson Date: Mon, 17 Mar 2008 14:18:26 +0000 Subject: [PATCH] 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: https://origsvn.digium.com/svn/asterisk/branches/1.4@109012 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- apps/app_chanspy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/app_chanspy.c b/apps/app_chanspy.c index 41e658037a..b97bfce713 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) -- 2.47.3