manager_channels.c: Fix allocation failure crash.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 13 Apr 2016 22:09:53 +0000 (17:09 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Fri, 22 Apr 2016 20:45:47 +0000 (15:45 -0500)
commitb3cc74fda954b330944397d5bbca4ff98698661f
tree2320dea406d415aae5a11a44122e9d39797afb02
parenta63656b41975a4f77c8d953b5dc7f966332892f4
manager_channels.c: Fix allocation failure crash.

An earlier allocation failure failed to create a channel snapshot for the
AMI HangupRequest/SoftHangupRequest event which resulted in a crash in
channel_hangup_request_cb().  Where the stasis message gets generated
cannot tell if the NULL snapshot returned was because of an allocation
failure or the channel was a dummy channel.

* Made channel_hangup_request_cb() check if the channel blob has a
snapshot and exit if it doesn't.

* Eliminated the RAII_VAR usage in channel_hangup_request_cb().

Change-Id: I0b6a1c4e95cbb7d80b2a7054c6eadecc169dfd24
main/manager_channels.c