diff options
author | Matthew Nicholson <mnicholson@digium.com> | 2009-09-17 15:18:01 +0000 |
---|---|---|
committer | Matthew Nicholson <mnicholson@digium.com> | 2009-09-17 15:18:01 +0000 |
commit | b27a54b8dea10b4eb2754a5915404c1b82c65519 (patch) | |
tree | 4fc7a3839b3764eaa1948d79ad0caf2c35f905f2 /main | |
parent | cd88adfc6a129a2d024018fe677a74ef178885ec (diff) |
Merged revisions 219136 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r219136 | mnicholson | 2009-09-17 09:58:39 -0500 (Thu, 17 Sep 2009) | 10 lines
Prevent a potential race condition and crash when hanging up a channel by removing the channel from the channel list before begining channel tear down.
This fix may potentially cause problems with CDR backends that access the channel a CDR is associated with via the channel list. This fix makes the channel unavabile at the time when the CDR backend is invoked. This has been documented in include/asterisk/cdr.h.
(closes issue #15316)
Reported by: vmarrone
Tested by: mnicholson
Review: https://reviewboard.asterisk.org/r/362/
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@219139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/channel.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c index b525d257b..f3e661d0e 100644 --- a/main/channel.c +++ b/main/channel.c @@ -2119,6 +2119,11 @@ int ast_hangup(struct ast_channel *chan) ast_channel_unlock(chan); return 0; } + ast_channel_unlock(chan); + + ao2_unlink(channels, chan); + + ast_channel_lock(chan); free_translation(chan); /* Close audio stream */ if (chan->stream) { |