<p>George Joseph <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11257">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Sean Bright: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved; Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip: Fix transport_states ref leak<br><br>Add missing ao2_ref(transport_state, -1) while iterate on a transport_states<br>container.<br><br>Change-Id: I40e35b5a339121300c80075c30db47201a6c374e<br>---<br>M res/res_pjsip/pjsip_message_filter.c<br>1 file changed, 6 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip/pjsip_message_filter.c b/res/res_pjsip/pjsip_message_filter.c</span><br><span>index 8a63219..5fe19f9 100644</span><br><span>--- a/res/res_pjsip/pjsip_message_filter.c</span><br><span>+++ b/res/res_pjsip/pjsip_message_filter.c</span><br><span>@@ -110,14 +110,13 @@</span><br><span> }</span><br><span> </span><br><span> for (iter = ao2_iterator_init(transport_states, 0); (transport_state = ao2_iterator_next(&iter)); ao2_ref(transport_state, -1)) {</span><br><span style="color: hsl(0, 100%, 40%);">- if (transport_state && ((transport_state->type != AST_TRANSPORT_UDP) ||</span><br><span style="color: hsl(0, 100%, 40%);">- (pj_strcmp(&transport_state->transport->local_name.host, address)) ||</span><br><span style="color: hsl(0, 100%, 40%);">- (transport_state->transport->local_name.port != port))) {</span><br><span style="color: hsl(0, 100%, 40%);">- continue;</span><br><span style="color: hsl(120, 100%, 40%);">+ if (transport_state->type == AST_TRANSPORT_UDP &&</span><br><span style="color: hsl(120, 100%, 40%);">+ !pj_strcmp(&transport_state->transport->local_name.host, address) &&</span><br><span style="color: hsl(120, 100%, 40%);">+ transport_state->transport->local_name.port == port) {</span><br><span style="color: hsl(120, 100%, 40%);">+ sip_transport = transport_state->transport;</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_ref(transport_state, -1);</span><br><span style="color: hsl(120, 100%, 40%);">+ break;</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- sip_transport = transport_state->transport;</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span> }</span><br><span> ao2_iterator_destroy(&iter);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11257">change 11257</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/+/11257"/><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: I40e35b5a339121300c80075c30db47201a6c374e </div>
<div style="display:none"> Gerrit-Change-Number: 11257 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexei Gradinari <alex2grad@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>