aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-06 21:46:01 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-06 21:46:01 +0000
commitb03533a403f2aaf1cf059839ae1aadc8852576cb (patch)
tree44917959ba16607389c4f380c9ac471c9568819d /main/channel.c
parente32af8f0cf3aaee58b28577c3b3690ecc43b4670 (diff)
Merged revisions 210913 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r210913 | tilghman | 2009-08-06 16:45:01 -0500 (Thu, 06 Aug 2009) | 7 lines Because channel information can be accessed outside of the channel thread, we must lock the channel prior to modifying it. (closes issue #15397) Reported by: caspy Patches: 20090714__issue15397.diff.txt uploaded by tilghman (license 14) Tested by: caspy ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210914 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index 2dba7eba2..a86ec3b34 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -2163,10 +2163,12 @@ int ast_hangup(struct ast_channel *chan)
if (chan->cdr && !ast_test_flag(chan->cdr, AST_CDR_FLAG_BRIDGED) &&
!ast_test_flag(chan->cdr, AST_CDR_FLAG_POST_DISABLED) &&
(chan->cdr->disposition != AST_CDR_NULL || ast_test_flag(chan->cdr, AST_CDR_FLAG_DIALED))) {
+ ast_channel_lock(chan);
ast_cdr_end(chan->cdr);
ast_cdr_detach(chan->cdr);
chan->cdr = NULL;
+ ast_channel_unlock(chan);
}
chan = ast_channel_release(chan);