mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 12:16:00 +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:
@@ -1546,6 +1546,18 @@ void ast_channel_internal_swap_topics(struct ast_channel *a, struct ast_channel
|
||||
b->topics = temp;
|
||||
}
|
||||
|
||||
void ast_channel_internal_swap_endpoint_forward_and_endpoint_cache_forward(struct ast_channel *a, struct ast_channel *b)
|
||||
{
|
||||
struct stasis_forward *temp;
|
||||
temp = a->endpoint_forward;
|
||||
a->endpoint_forward = b->endpoint_forward;
|
||||
b->endpoint_forward = temp;
|
||||
|
||||
temp = a->endpoint_cache_forward;
|
||||
a->endpoint_cache_forward = b->endpoint_cache_forward;
|
||||
b->endpoint_cache_forward = temp;
|
||||
}
|
||||
|
||||
void ast_channel_internal_set_fake_ids(struct ast_channel *chan, const char *uniqueid, const char *linkedid)
|
||||
{
|
||||
ast_copy_string(chan->uniqueid.unique_id, uniqueid, sizeof(chan->uniqueid.unique_id));
|
||||
|
Reference in New Issue
Block a user