<p>Kevin Harwell <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11141">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua C. Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, approved; Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_queue: fix ring_entry to access nativeformats with a channel lock<br><br>Fixes an intermittent segmentation fault which occured when accessing<br>nativeformats of a channel which entered into a queue.<br><br>ASTERISK-27964<br>Reported by: Francisco Seratti<br><br>Change-Id: Ic87fa7a363f3b487c24ce07032f4b2201c22db9e<br>---<br>M apps/app_queue.c<br>1 file changed, 7 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_queue.c b/apps/app_queue.c</span><br><span>index 10dd06a..72bc57b 100644</span><br><span>--- a/apps/app_queue.c</span><br><span>+++ b/apps/app_queue.c</span><br><span>@@ -4497,6 +4497,7 @@</span><br><span>      char tech[256];</span><br><span>      char *location;</span><br><span>      const char *macrocontext, *macroexten;</span><br><span style="color: hsl(120, 100%, 40%);">+        struct ast_format_cap *nativeformats;</span><br><span>        RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref);</span><br><span> </span><br><span>         /* on entry here, we know that tmp->chan == NULL */</span><br><span>@@ -4513,8 +4514,13 @@</span><br><span>              location = "";</span><br><span>     }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ ast_channel_lock(qe->chan);</span><br><span style="color: hsl(120, 100%, 40%);">+        nativeformats = ao2_bump(ast_channel_nativeformats(qe->chan));</span><br><span style="color: hsl(120, 100%, 40%);">+     ast_channel_unlock(qe->chan);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>   /* Request the peer */</span><br><span style="color: hsl(0, 100%, 40%);">-  tmp->chan = ast_request(tech, ast_channel_nativeformats(qe->chan), NULL, qe->chan, location, &status);</span><br><span style="color: hsl(120, 100%, 40%);">+   tmp->chan = ast_request(tech, nativeformats, NULL, qe->chan, location, &status);</span><br><span style="color: hsl(120, 100%, 40%);">+    ao2_cleanup(nativeformats);</span><br><span>  if (!tmp->chan) {                    /* If we can't, just go on to the next call */</span><br><span>           ao2_lock(qe->parent);</span><br><span>             qe->parent->rrpos++;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11141">change 11141</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/+/11141"/><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: Ic87fa7a363f3b487c24ce07032f4b2201c22db9e </div>
<div style="display:none"> Gerrit-Change-Number: 11141 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua C. Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Gergely Dömsödi <doome@uhusystems.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua C. Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>