stasis/endpoint: Fix memory leak of channel_ids in ast_endpoint structure.
authormohitdhiman <mohitdhiman@drishti-soft.com>
Sat, 12 Jan 2019 08:29:12 +0000 (13:59 +0530)
committermohitdhiman <mohitdhiman@drishti-soft.com>
Mon, 14 Jan 2019 11:37:35 +0000 (17:07 +0530)
commitd60ee2eeaec7f0a298e95aa37d179d391f8871dd
treea5ec7e1c5b007509891f1561bce02726f5eb23a7
parent28dbb06e8ccf8d78a62d3df01e2b8abccdae87b9
stasis/endpoint: Fix memory leak of channel_ids in ast_endpoint structure.

During Bridging of two channels if masquerade operation is performed on a
channel (clone channel) which was created with endpoint details
(ast_channel_alloc_with_endpoint()) and the original channel which is created
without endpoint details (ast_channel_alloc()) then both the channels must
exchange their endpoint details or else after masquerade when clone channel
is being destroyed the endpoint cleanup callbacks will be destroyed too and
after call completion unique_id of original channel will still be there in
ast_endpoint structure's channel_ids container.

ASTERISK-28197

Change-Id: I97ce73da390af20fd082fb09d722a6fe9cb2f39d
include/asterisk/channel.h
main/channel.c
main/channel_internal_api.c