From: Tilghman Lesher Date: Thu, 6 Aug 2009 21:47:17 +0000 (+0000) Subject: Merged revisions 210914 via svnmerge from X-Git-Tag: 1.6.1.5-rc1~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5871c2e5a86dec5278a0787040419e9152952960;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@210916 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/channel.c b/main/channel.c index e054d7b952..c7f412bfc9 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1717,10 +1717,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);