aboutsummaryrefslogtreecommitdiffstats
path: root/main/channel.c
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-02 22:15:57 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2008-09-02 22:15:57 +0000
commitbc36ad3cc87dbf399f9fe36db6b7a41ba83b8895 (patch)
treed2505c05e7bba184ab97082cfb77a91a03d9daf0 /main/channel.c
parentf3d350391e14ccbbc1f06d20cf4885681b72175e (diff)
(closes issue #13409)
Reported by: tomaso Patches: asterisk-1.6.0-rc2-cdrmemleak.patch uploaded by tomaso (license 564) I basically spent the day, verifying that this patch solves the problem, and doesn't hurt in non-problem cases. Why valgrind did not plainly reveal this leak absolutely mystifies and stuns me. Many, many thanks to tomaso for finding and providing the fix. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@140670 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c
index 3006e71cb..3bbccff7c 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -1277,6 +1277,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);
@@ -1523,6 +1528,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);