<p>Corey Farrell <strong>posted comments</strong> on this change.</p><p><a href="https://gerrit.asterisk.org/6857">View Change</a></p><p>Patch set 1:</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">Is this a master-only thing or are cherry-picks coming?</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">This is an issue for 15 and master.  I'm not going to cherry-pick until I'm more confident of the fix.</p><p>(1 comment)</p><ul style="list-style: none; padding-left: 20px;"><li><p><a href="https://gerrit.asterisk.org/#/c/6857/1/res/res_pjsip_pubsub.c">File res/res_pjsip_pubsub.c:</a></p><ul style="list-style: none; padding-left: 20px;"><li><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/6857/1/res/res_pjsip_pubsub.c@3683">Patch Set #1, Line 3683:</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_tree->root) {<br>              ast_sip_subscription_destroy(sub_tree->root);<br>      }<br></pre></blockquote></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I think before this is done we need to document the specific lifetime and r</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I'd love to do that but I'm not fully confident that I understand the lifecycle of subscription trees.  At this stage I've posted this patch to say:<br>This seems to fix the error, does it seem reasonable/correct?</p><p style="white-space: pre-wrap; word-wrap: break-word;">I have traced out all +1/-1 references on subscription tree's, I have determined that sub_tree->root->tree is never released.  I do not know if this is the correct place to release that reference.</p><p style="white-space: pre-wrap; word-wrap: break-word;">In the reference logs I've reviewed the ao2_ref(sub_tree, -1) below (Remove evsub's reference) is another one I'm not fully sure of.  I believe evsub is holding the allocation reference?  If that's the case I can add a comment to the subscription tree allocation routine.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/6857">change 6857</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/6857"/><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: I7baddee3c16dfdc5a12fa652c5359de465e9ebbf </div>
<div style="display:none"> Gerrit-Change-Number: 6857 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 23 Oct 2017 17:26:51 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>