[Asterisk-code-review] res_stasis: Add ability to switch applications. (...asterisk[13])
Kevin Harwell
asteriskteam at digium.com
Fri Mar 1 14:15:23 CST 2019
Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/10937 )
Change subject: res_stasis: Add ability to switch applications.
......................................................................
Patch Set 10: Code-Review-1
(6 comments)
https://gerrit.asterisk.org/#/c/10937/10/res/stasis/control.c
File res/stasis/control.c:
https://gerrit.asterisk.org/#/c/10937/10/res/stasis/control.c@482
PS10, Line 482: char *app_name;
If you make this a zero length array at the end of the struct it'll save an allocation.
https://gerrit.asterisk.org/#/c/10937/10/res/stasis/control.c@501
PS10, Line 501: ast_free(arg);
You'll need a custom destructor passed to the send_command_async (see below). This too should be moved to your custom destructor.
https://gerrit.asterisk.org/#/c/10937/10/res/stasis/control.c@504
PS10, Line 504: AST_VECTOR_FREE(&move_data->args);
Once you add your custom destructor I _dont't_ think you'll need to do this.
https://gerrit.asterisk.org/#/c/10937/10/res/stasis/control.c@522
PS10, Line 522: return -1;
move_data needs to be free'd here.
https://gerrit.asterisk.org/#/c/10937/10/res/stasis/control.c@529
PS10, Line 529: ast_free(move_data->app_name);
move_data is leaked here
https://gerrit.asterisk.org/#/c/10937/10/res/stasis/control.c@540
PS10, Line 540: stasis_app_send_command_async(control, app_control_move, move_data, ast_free_ptr);
You can't use ast_free_ptr here to release move_data's memory since that will free move_data, but not its member's memory. For instance currently neither app_name or args memory will be released. You'll have to create your own custom "destructor".
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/10937
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: I43d12b10045a98a8d42541889b85695be26f288a
Gerrit-Change-Number: 10937
Gerrit-PatchSet: 10
Gerrit-Owner: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Fri, 01 Mar 2019 20:15:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190301/0cc3189b/attachment-0001.html>
More information about the asterisk-code-review
mailing list