<p>Kevin Harwell <strong>posted comments</strong> on this change.</p><p><a href="https://gerrit.asterisk.org/7494">View Change</a></p><p>Patch set 3:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p>(6 comments)</p><ul style="list-style: none; padding-left: 20px;"><li><p><a href="https://gerrit.asterisk.org/#/c/7494/3/apps/app_voicemail.c">File apps/app_voicemail.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7494/3/apps/app_voicemail.c@13299">Patch Set #3, Line 13299:</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;">        AST_LIST_LOCK(&users);<br><br>  /* no any voicemail user */<br>   if (AST_LIST_EMPTY(&users)) {<br>             astman_send_ack(s, m, "There are no voicemail users currently defined.");<br>           AST_LIST_UNLOCK(&users);<br>          return RESULT_SUCCESS;<br>        }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This can be removed (The locking/unlocking and empty check). The call to find_user locks the list before searching. If it is empty find_user will return NULL.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7494/3/apps/app_voicemail.c@13308">Patch Set #3, Line 13308:</a> <code style="font-family:monospace,monospace"> // find user</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This needs to be converted to 'C' style comments, /* */</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7494/3/apps/app_voicemail.c@13312">Patch Set #3, Line 13312:</a> <code style="font-family:monospace,monospace">         // could not find it</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This too</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7494/3/apps/app_voicemail.c@13320">Patch Set #3, Line 13320:</a> <code style="font-family:monospace,monospace">        // get mailbox count</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">One more.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7494/3/apps/app_voicemail.c@13321">Patch Set #3, Line 13321:</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;">  inboxcount(vmu->mailbox, &new, &old);<br><br>    astman_append(s,<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Some of the code in this function is a copy of the code from manager_list_voicemail_users (at least the two items highlighted if not more).</p><p style="white-space: pre-wrap; word-wrap: break-word;">I'd prefer this to be rewritten to avoid the code duplication. For instance a third function with the shared code that both can call.</p></li><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/7494/3/apps/app_voicemail.c@13396">Patch Set #3, Line 13396:</a> <code style="font-family:monospace,monospace"></code></p><p style="white-space: pre-wrap; word-wrap: break-word;">vmu leaks memory. You need to call free_user(vmu) when done with it.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/7494">change 7494</a>. To unsubscribe, 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/7494"/><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-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: Ie4eba1424a142e5fbd1d9fb1821a3fc1a1e238b7 </div>
<div style="display:none"> Gerrit-Change-Number: 7494 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: sungtae kim <pchero21@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Matthew Fredrickson <creslin@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: sungtae kim <pchero21@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 12 Dec 2017 15:43:15 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>