]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Because channel information can be accessed outside of the channel thread, we must...
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 6 Aug 2009 21:45:01 +0000 (21:45 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 6 Aug 2009 21:45:01 +0000 (21:45 +0000)
(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.4@210913 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/channel.c

index f548d0e6b085eee7cfcd824c4f2345236809ad2a..6b1582180fd0a3acf7c928fc0848321b9b919533 100644 (file)
@@ -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);