diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-08-06 21:45:01 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-08-06 21:45:01 +0000 |
commit | d36a071288f50a6f40a57964e128aaef22d76bb4 (patch) | |
tree | d4c47938900f67ca41a78244dce630c6c5ec2cbd /main | |
parent | da7caf451097558dc88ec7e6426d475d15f4d40b (diff) |
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.4@210913 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/channel.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c index f548d0e6b..6b1582180 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1566,10 +1566,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); |