<p>Patch set 2:<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/+/11304">View Change</a></p><p>4 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/11304/2/main/stasis.c">File main/stasis.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/11304/2/main/stasis.c@412">Patch Set #2, Line 412:</a> <code style="font-family:monospace,monospace"> if (topic->statistics && topic_stats) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Separate these checks since the associated tasks to each check are not dependent on the other.</p><p style="white-space: pre-wrap; word-wrap: break-word;">For instance, as it is now there is a ref leak on topic->statistics if it is not NULL, but topic_stats is.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11304/2/main/stasis.c@587">Patch Set #2, Line 587:</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 (sub->statistics && subscription_stats) {<br>               ao2_unlink(subscription_stats, sub->statistics);<br>           ao2_ref(sub->statistics, -1);<br>      }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Same thing here as far as separating the checks. sub->statistics can potentially be ref leaked.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11304/2/main/stasis.c@2281">Patch Set #2, Line 2281:</a> <code style="font-family:monospace,monospace">   RAII_VAR(struct ao2_container *, subscription_stats, ao2_global_obj_ref(subscription_statistics), ao2_cleanup);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Drop the RAII_VAR and retrieve it just before the find below and unref it just after.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/11304/2/main/stasis.c@2467">Patch Set #2, Line 2467:</a> <code style="font-family:monospace,monospace">      RAII_VAR(struct ao2_container *, topic_stats, ao2_global_obj_ref(topic_statistics), ao2_cleanup);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">No real need for a RAII_VAR here too.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11304">change 11304</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/+/11304"/><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: Ie7d5e907fcfcb4d65bd36d5e4eb923126fde8d33 </div>
<div style="display:none"> Gerrit-Change-Number: 11304 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 23 Apr 2019 21:56:26 +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>