<p>Patch set 5:<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>7 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/11579/5/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/5/channels/chan_audiosocket.c@170">Patch Set #5, Line 170:</a> <code style="font-family:monospace,monospace">       instance = ast_calloc(1, sizeof(*instance));</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Need to check that calloc() succeeded.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/5/channels/chan_audiosocket.c@177">Patch Set #5, Line 177:</a> <code style="font-family:monospace,monospace">            struct ast_str *cap_buf = ast_str_alloca(AST_FORMAT_CAP_NAMES_LEN);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Need to check that ast_str_alloc() succeeded.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/11579/5/res/res_audiosocket.c">File res/res_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/5/res/res_audiosocket.c@74">Patch Set #5, Line 74:</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;">              if ((s = socket(addrs[i].ss.ss_family, SOCK_STREAM, IPPROTO_TCP)) < 0) {<br>                   ast_log(LOG_WARNING, "unable to create socket: %s\n", strerror(errno));<br>                     continue;<br>             }<br><br>           if (ast_fd_set_flags(s, O_NONBLOCK)) {<br>                        close(s);<br>                     continue;<br>             }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">If you use `ast_socket_nonblock()` instead of `socket()` you can remove the explicit call to `ast_fd_set_flags()`.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/5/res/res_audiosocket.c@168">Patch Set #5, Line 168:</a> <code style="font-family:monospace,monospace">     //char idBuf[AST_UUID_STR_LEN+1];</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Shouldn't use C++ comment syntax. There are several places in this file where this occurs, so make sure to take care of them all. This particular line should probably just be deleted altogether.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/5/res/res_audiosocket.c@181">Patch Set #5, Line 181:</a> <code style="font-family:monospace,monospace">     buf = ast_malloc(3 + 16);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Is there a reason not to just stack allocate here? e.g. uint8_t buf[19]</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/5/res/res_audiosocket.c@204">Patch Set #5, Line 204:</a> <code style="font-family:monospace,monospace">    buf = ast_malloc(3 + f->datalen);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Need to check that malloc() succeeded.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11579/5/res/res_audiosocket.c@271">Patch Set #5, Line 271:</a> <code style="font-family:monospace,monospace">  data = ast_malloc(len);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Need to check that malloc() succeeded.</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: 5 </div>
<div style="display:none"> Gerrit-Owner: Seán C. McCord <ulexus@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Seán C. McCord <ulexus@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 18 Jul 2019 20:29:18 +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>