<p style="white-space: pre-wrap; word-wrap: break-word;">The solution looks like the best you can do with the situation and the way the code is structured.  There are a couple more exit points that have the same issue that I have pointed out.</p><p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/10048">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10048/2/apps/app_queue.c">File apps/app_queue.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/10048/2/apps/app_queue.c@6774">Patch Set #2, Line 6774:</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_autoservice_chan_hangup_peer(qe->chan, peer);<br>                          ao2_ref(member, -1);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Need to put the following between these two lines here for the same reason: We have not bridged the caller and peer yet.</p><p style="white-space: pre-wrap; word-wrap: break-word;">pending_members_remove(member);</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10048/2/apps/app_queue.c@6793">Patch Set #2, Line 6793:</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_autoservice_chan_hangup_peer(qe->chan, peer);<br>                  ao2_ref(member, -1);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Need to put the following between these two lines here for the same reason: We have not bridged the caller and peer yet.</p><p style="white-space: pre-wrap; word-wrap: break-word;">pending_members_remove(member);</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10048">change 10048</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/10048"/><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-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: Ib780fbf48ace9d2d8eaa1270b9d530a4fc14c855 </div>
<div style="display:none"> Gerrit-Change-Number: 10048 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Cao Minh Hiep <chiep@infinitalk.co.jp> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jaco Kroon <jaco@uls.co.za> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 21 Sep 2018 21:13:31 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>