]> git.ipfire.org Git - thirdparty/asterisk.git/commit
valgrind reported references to freed memory during a mISDN hangup collision.
authorRichard Mudgett <rmudgett@digium.com>
Mon, 8 Nov 2010 17:16:01 +0000 (17:16 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Mon, 8 Nov 2010 17:16:01 +0000 (17:16 +0000)
commit4e39e38ac505749db14f00437813f854094662d0
tree897df4b8afc6f83b6131a8f87fadb201e8c59f35
parente1a1360451de5c8dd833f0c239777ae16cd43ab5
valgrind reported references to freed memory during a mISDN hangup collision.

Bad things have been happening in chan_misdn because the chan_misdn
channel private struct chan_list is not protected from reentrancy.  Hangup
collisions have be causing read and write accesses to freed memory.

Converted chan_misdn struct chan_list to an ao2 object for its reference
counting feature.

**********
Removed an impediment to converting chan_list to an ao2 object.

The use of the other_ch member in chan_list is shaky at best.  It is set
if the incoming and outgoing call legs are mISDN.  The use of the other_ch
member goes against the Asterisk architecture and can even cause problems.

1) It is used to disable echo cancellation.  This could be bad if the call
is forked and the winning call leg is not mISDN or the winning call leg is
not the last mISDN channel called by the fork.  The other_ch would become
a dangling pointer.

2) It is used when the far end is alerting to hear the far end's inband
audio instead of Asterisk's generated ringback tone.  This is bad if the
call is forked.  You would only hear the last forked mISDN channel and it
may not be ringing yet.

The other_ch would become a dangling pointer if the call is later
transferred.
**********

JIRA SWP-2423
JIRA ABE-2614

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
channels/chan_misdn.c