diff options
author | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-09-02 22:50:59 +0000 |
---|---|---|
committer | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-09-02 22:50:59 +0000 |
commit | f3df28216acc3c8eb7d03e54b7c278944b70eb3c (patch) | |
tree | 6193710b22ba8fe01ed49bb6784a3be4897d5687 /main/channel.c | |
parent | 1a4691bd394657b1dea940beeb9e2e8ae5097836 (diff) |
Merged revisions 140670 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r140670 | murf | 2008-09-02 16:15:57 -0600 (Tue, 02 Sep 2008) | 14 lines
(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/trunk@140691 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c index 77a790802..2596a0037 100644 --- a/main/channel.c +++ b/main/channel.c @@ -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); |