mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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: Ied0451f378a3f2a36acc8c0984959a69895efa17
This commit is contained in:
committed by
Mohit Dhiman
parent
701cd2ee58
commit
4b24da607e
@@ -6819,6 +6819,12 @@ static void channel_do_masquerade(struct ast_channel *original, struct ast_chann
|
||||
/* Make sure the Stasis topic on the channel is updated appropriately */
|
||||
ast_channel_internal_swap_topics(clonechan, original);
|
||||
|
||||
/* Swap endpoint forward and endpoint cache forward details of the channels,
|
||||
* so channel created with endpoint exchanges its state with other channel
|
||||
* for proper endpoint cleanup.
|
||||
*/
|
||||
ast_channel_internal_swap_endpoint_forward_and_endpoint_cache_forward(clonechan, original);
|
||||
|
||||
/* Swap channel names. This uses ast_channel_name_set directly, so we
|
||||
* don't get any spurious rename events.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user