<p>Patch set 10:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/10937">View Change</a></p><p>6 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10937/10/res/stasis/control.c">File res/stasis/control.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10937/10/res/stasis/control.c@482">Patch Set #10, Line 482:</a> <code style="font-family:monospace,monospace">        char *app_name;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">If you make this a zero length array at the end of the struct it'll save an allocation.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10937/10/res/stasis/control.c@501">Patch Set #10, Line 501:</a> <code style="font-family:monospace,monospace">         ast_free(arg);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">You'll need a custom destructor passed to the send_command_async (see below). This too should be moved to your custom destructor.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10937/10/res/stasis/control.c@504">Patch Set #10, Line 504:</a> <code style="font-family:monospace,monospace">        AST_VECTOR_FREE(&move_data->args);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Once you add your custom destructor I _dont't_ think you'll need to do this.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10937/10/res/stasis/control.c@522">Patch Set #10, Line 522:</a> <code style="font-family:monospace,monospace">              return -1;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">move_data needs to be free'd here.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10937/10/res/stasis/control.c@529">Patch Set #10, Line 529:</a> <code style="font-family:monospace,monospace">                   ast_free(move_data->app_name);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">move_data is leaked here</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10937/10/res/stasis/control.c@540">Patch Set #10, Line 540:</a> <code style="font-family:monospace,monospace">  stasis_app_send_command_async(control, app_control_move, move_data, ast_free_ptr);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">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".</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/10937">change 10937</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/10937"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: I43d12b10045a98a8d42541889b85695be26f288a </div>
<div style="display:none"> Gerrit-Change-Number: 10937 </div>
<div style="display:none"> Gerrit-PatchSet: 10 </div>
<div style="display:none"> Gerrit-Owner: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 01 Mar 2019 20:15:23 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>