<p>Joshua C. Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10742">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
Joshua C. Colp: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_sip: Fix leak using contact ACL<br><br>Free old peer's contactacl before overwrite it within build_peer.<br><br>ASTERISK-28194<br><br>Change-Id: Ie580db6494e50cee0e2a44b38e568e34116ff54c<br>---<br>M channels/chan_sip.c<br>1 file changed, 6 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_sip.c b/channels/chan_sip.c</span><br><span>index d90c1c7..e1f6f13 100644</span><br><span>--- a/channels/chan_sip.c</span><br><span>+++ b/channels/chan_sip.c</span><br><span>@@ -5267,6 +5267,7 @@</span><br><span> </span><br><span> register_peer_exten(peer, FALSE);</span><br><span> ast_free_acl_list(peer->acl);</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_free_acl_list(peer->contactacl);</span><br><span> ast_free_acl_list(peer->directmediaacl);</span><br><span> if (peer->selfdestruct)</span><br><span> ast_atomic_fetchadd_int(&apeerobjs, -1);</span><br><span>@@ -21036,6 +21037,7 @@</span><br><span> ast_cli(fd, " Force rport : %s\n", force_rport_string(peer->flags));</span><br><span> ast_cli(fd, " Symmetric RTP: %s\n", comedia_string(peer->flags));</span><br><span> ast_cli(fd, " ACL : %s\n", AST_CLI_YESNO(ast_acl_list_is_empty(peer->acl) == 0));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_cli(fd, " ContactACL : %s\n", AST_CLI_YESNO(ast_acl_list_is_empty(peer->contactacl) == 0));</span><br><span> ast_cli(fd, " DirectMedACL : %s\n", AST_CLI_YESNO(ast_acl_list_is_empty(peer->directmediaacl) == 0));</span><br><span> ast_cli(fd, " T.38 support : %s\n", AST_CLI_YESNO(ast_test_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT)));</span><br><span> ast_cli(fd, " T.38 EC mode : %s\n", faxec2str(ast_test_flag(&peer->flags[1], SIP_PAGE2_T38SUPPORT)));</span><br><span>@@ -31280,6 +31282,7 @@</span><br><span> struct ast_variable *v = v_head;</span><br><span> struct sip_peer *peer = NULL;</span><br><span> struct ast_acl_list *oldacl = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ struct ast_acl_list *oldcontactacl = NULL;</span><br><span> struct ast_acl_list *olddirectmediaacl = NULL;</span><br><span> int found = 0;</span><br><span> int firstpass = 1;</span><br><span>@@ -31359,6 +31362,8 @@</span><br><span> if (firstpass) {</span><br><span> oldacl = peer->acl;</span><br><span> peer->acl = NULL;</span><br><span style="color: hsl(120, 100%, 40%);">+ oldcontactacl = peer->contactacl;</span><br><span style="color: hsl(120, 100%, 40%);">+ peer->contactacl = NULL;</span><br><span> olddirectmediaacl = peer->directmediaacl;</span><br><span> peer->directmediaacl = NULL;</span><br><span> set_peer_defaults(peer); /* Set peer defaults */</span><br><span>@@ -32022,6 +32027,7 @@</span><br><span> peer->the_mark = 0;</span><br><span> </span><br><span> oldacl = ast_free_acl_list(oldacl);</span><br><span style="color: hsl(120, 100%, 40%);">+ oldcontactacl = ast_free_acl_list(oldcontactacl);</span><br><span> olddirectmediaacl = ast_free_acl_list(olddirectmediaacl);</span><br><span> if (!ast_strlen_zero(peer->callback)) { /* build string from peer info */</span><br><span> char *reg_string;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10742">change 10742</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/10742"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ie580db6494e50cee0e2a44b38e568e34116ff54c </div>
<div style="display:none"> Gerrit-Change-Number: 10742 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Giuseppe Sucameli <sucameli@netresults.it> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua C. Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>