<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7647">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_sip: Fix memory leaks.<br><br>In change_redirecting_information variables we use ast_strlen_zero to<br>see if a value should be saved. In the case where the value is not NULL<br>but is a zero length string we leaked.<br><br>handle_response_subscribe leaked a reference to the ccss monitor<br>instance.<br><br>Change-Id: Ib11444de69c3d5b2360a88ba2feb54d2c2e9f05f<br>---<br>M channels/chan_sip.c<br>1 file changed, 9 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/47/7647/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/channels/chan_sip.c b/channels/chan_sip.c<br>index e54997b..ef6a860 100644<br>--- a/channels/chan_sip.c<br>+++ b/channels/chan_sip.c<br>@@ -23430,6 +23430,8 @@<br> redirecting->from.number.valid = 1;<br> ast_free(redirecting->from.number.str);<br> redirecting->from.number.str = redirecting_from_number;<br>+ } else {<br>+ ast_free(redirecting_from_number);<br> }<br> if (!ast_strlen_zero(redirecting_from_name)) {<br> ast_debug(3, "Got redirecting from name %s\n", redirecting_from_name);<br>@@ -23437,6 +23439,8 @@<br> redirecting->from.name.valid = 1;<br> ast_free(redirecting->from.name.str);<br> redirecting->from.name.str = redirecting_from_name;<br>+ } else {<br>+ ast_free(redirecting_from_name);<br> }<br> if (!ast_strlen_zero(p->cid_tag)) {<br> ast_free(redirecting->from.tag);<br>@@ -23450,6 +23454,8 @@<br> redirecting->to.number.valid = 1;<br> ast_free(redirecting->to.number.str);<br> redirecting->to.number.str = redirecting_to_number;<br>+ } else {<br>+ ast_free(redirecting_to_number);<br> }<br> if (!ast_strlen_zero(redirecting_to_name)) {<br> ast_debug(3, "Got redirecting to name %s\n", redirecting_from_number);<br>@@ -23457,6 +23463,8 @@<br> redirecting->to.name.valid = 1;<br> ast_free(redirecting->to.name.str);<br> redirecting->to.name.str = redirecting_to_name;<br>+ } else {<br>+ ast_free(redirecting_to_name);<br> }<br> redirecting->reason.code = reason;<br> ast_free(redirecting->reason.str);<br>@@ -24486,6 +24494,7 @@<br> ast_cc_monitor_failed(monitor_instance->core_id,<br> monitor_instance->device_name,<br> "Received error response to our SUBSCRIBE");<br>+ ao2_ref(monitor_instance, -1);<br> }<br> return;<br> }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7647">change 7647</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/7647"/><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: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ib11444de69c3d5b2360a88ba2feb54d2c2e9f05f </div>
<div style="display:none"> Gerrit-Change-Number: 7647 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>