Merged revisions 140670 via svnmerge from
[asterisk/asterisk.git] / main / channel.c
index 77a7908..2596a00 100644 (file)
@@ -1360,6 +1360,11 @@ void ast_channel_free(struct ast_channel *chan)
 
        /* Destroy the jitterbuffer */
        ast_jb_destroy(chan);
+
+       if (chan->cdr) {
+               ast_cdr_free(chan->cdr);
+               chan->cdr = NULL;
+       }
        
        ast_mutex_destroy(&chan->lock_dont_use);
 
@@ -1642,6 +1647,7 @@ int ast_hangup(struct ast_channel *chan)
                        
                ast_cdr_end(chan->cdr);
                ast_cdr_detach(chan->cdr);
+               chan->cdr = NULL;
        }
        
        ast_channel_free(chan);