aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-06 21:46:41 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-08-06 21:46:41 +0000
commit96f19b6d17a15bdbb6ecfb40a94d9c3394245fb8 (patch)
tree3565b283326934b16d603e8023d42c315744fbc4
parenteac30d741194acadac0a26f1ad3cec1e32a86ca2 (diff)
Merged revisions 210914 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r210914 | tilghman | 2009-08-06 16:46:01 -0500 (Thu, 06 Aug 2009) | 14 lines 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/branches/1.6.0@210915 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--main/channel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index 3a0e53c1a..05b98430b 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -1726,10 +1726,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);
}
ast_channel_free(chan);