<p>Patch set 20:<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/+/11579">View Change</a></p><p>3 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/11579/20/apps/app_audiosocket.c">File apps/app_audiosocket.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/11579/20/apps/app_audiosocket.c@113">Patch Set #20, Line 113:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><br>   writeFormat = ast_channel_writeformat(chan);<br>  ao2_ref(writeFormat, +1);<br>     readFormat = ast_channel_readformat(chan);<br>    ao2_ref(readFormat, +1);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Not something that needs to be done, but you can always use ao2_bump instead of a pattern like this.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/20/apps/app_audiosocket.c@198">Patch Set #20, Line 198:</a> <code style="font-family:monospace,monospace">         ast_waitfor_nandfds(&chan, 1, &svc, 1, NULL, &outfd, &ms);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Instead of ast_waitfor above you would use this instead and then based on the result you would know whether the channel needed to be read or the audiosocket file descriptor.</p><p style="white-space: pre-wrap; word-wrap: break-word;">If the function returned a channel you read the channel. If the function returned a file descriptor you read the audiosocket.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/11579/20/channels/chan_audiosocket.c">File channels/chan_audiosocket.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/11579/20/channels/chan_audiosocket.c@210">Patch Set #20, Line 210:</a> <code style="font-family:monospace,monospace">             ast_free(instance);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think this will cause a file descriptor leak in the case where chan fails to get allocated.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11579">change 11579</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/+/11579"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ie866e6c4fa13178ec76f2a6971ad3590a3a588b5 </div>
<div style="display:none"> Gerrit-Change-Number: 11579 </div>
<div style="display:none"> Gerrit-PatchSet: 20 </div>
<div style="display:none"> Gerrit-Owner: Seán C. McCord <ulexus@gmail.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: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Seán C. McCord <ulexus@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 16 Oct 2019 11:57: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>