[Asterisk-code-review] stasis/endpoint: Fix memory leak of channel ids in ast endpo... (asterisk[13])

Corey Farrell asteriskteam at digium.com
Fri Jan 11 07:30:29 CST 2019


Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/10859 )

Change subject: stasis/endpoint: Fix memory leak of channel_ids in ast_endpoint structure.
......................................................................


Patch Set 1: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/10859/1/include/asterisk/channel.h
File include/asterisk/channel.h:

https://gerrit.asterisk.org/#/c/10859/1/include/asterisk/channel.h@2601
PS1, Line 2601: void ast_channel_internal_swap_endpoint_forward_and_endpoint_cache_forward(struct ast_channel *a, struct ast_channel *b);
> Thank you Corey for your suggestion. […]
You're probably right.  If we're going to do anything about this it should probably be done against all the functions (not part of this commit).


https://gerrit.asterisk.org/#/c/10859/1/main/channel_internal_api.c
File main/channel_internal_api.c:

https://gerrit.asterisk.org/#/c/10859/1/main/channel_internal_api.c@1549
PS1, Line 1549: void ast_channel_internal_swap_endpoint_forward_and_endpoint_cache_forward(struct ast_channel *a, struct ast_channel *b)
IMO the conditionals in this function just makes it more difficult to read.  I feel it should be simplified as follows:

```
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;
```



-- 
To view, visit https://gerrit.asterisk.org/10859
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: Ied0451f378a3f2a36acc8c0984959a69895efa17
Gerrit-Change-Number: 10859
Gerrit-PatchSet: 1
Gerrit-Owner: Mohit Dhiman <mohitdhiman at drishti-soft.com>
Gerrit-Reviewer: Chris Savinovich <csavinovich at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Friendly Automation (1000185)
Gerrit-Reviewer: Mohit Dhiman <mohitdhiman at drishti-soft.com>
Gerrit-Comment-Date: Fri, 11 Jan 2019 13:30:29 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190111/514501cd/attachment.html>


More information about the asterisk-code-review mailing list