core_local: local channel data not being properly unref'ed and unlocked
authorKevin Harwell <kharwell@digium.com>
Tue, 20 Jun 2017 21:05:08 +0000 (16:05 -0500)
committerKevin Harwell <kharwell@digium.com>
Wed, 21 Jun 2017 21:18:13 +0000 (16:18 -0500)
commit27dae55fb6bf802befe6f398d02f278f2c31114c
treeec5d10c92d43dde00d95856bb7d99c0304c1f07d
parent0c0d69d4f38756c2f83d2c9007033e0ca05652c4
core_local: local channel data not being properly unref'ed and unlocked

In an earlier version of Asterisk a local channel [un]lock all functions were
added in order to keep a crash from occurring when a channel hung up too early
during an attended transfer. Unfortunately, when a transfer failure occurs and
depending on the timing, the local channels sometime do not get properly
unlocked and deref'ed after being locked and ref'ed. This happens because the
underlying local channel structure gets NULLed out before unlocking.

This patch reworks those [un]lock functions and makes sure the values that get
locked and ref'ed later get unlocked and deref'ed.

ASTERISK-27074 #close

Change-Id: Ice96653e29bd9d6674ed5f95feb6b448ab148b09
include/asterisk/core_local.h
main/bridge.c
main/core_local.c