<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/8126">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Corey Farrell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve
  Sean Bright: Looks good to me, approved
  Jenkins2: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">manager_channels.c: Reordered ast_manager_build_channel_state_string_prefix()<br><br>* Made not allocate memory if the channel snapshot is an internal channel.<br><br>* Free memory earlier when no longer needed.<br><br>Change-Id: Ia06e0c065f1bd095781aa3f4a626d58fa4d28b38<br>---<br>M main/manager_channels.c<br>1 file changed, 10 insertions(+), 11 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/manager_channels.c b/main/manager_channels.c<br>index 71c1732..6938c6e 100644<br>--- a/main/manager_channels.c<br>+++ b/main/manager_channels.c<br>@@ -463,16 +463,17 @@<br>              const struct ast_channel_snapshot *snapshot,<br>          const char *prefix)<br> {<br>-      struct ast_str *out = ast_str_create(1024);<br>-  int res = 0;<br>- char *caller_name, *connected_name;<br>+  struct ast_str *out;<br>+ char *caller_name;<br>+   char *connected_name;<br>+        int res;<br> <br>-  if (!out) {<br>+  if (snapshot->tech_properties & AST_CHAN_TP_INTERNAL) {<br>                return NULL;<br>  }<br> <br>- if (snapshot->tech_properties & AST_CHAN_TP_INTERNAL) {<br>-               ast_free(out);<br>+       out = ast_str_create(1024);<br>+  if (!out) {<br>           return NULL;<br>  }<br> <br>@@ -509,10 +510,11 @@<br>           prefix, snapshot->uniqueid,<br>                prefix, snapshot->linkedid);<br> <br>+   ast_free(caller_name);<br>+       ast_free(connected_name);<br>+<br>  if (!res) {<br>           ast_free(out);<br>-               ast_free(caller_name);<br>-               ast_free(connected_name);<br>             return NULL;<br>  }<br> <br>@@ -527,9 +529,6 @@<br>                     ast_free(val);<br>                }<br>     }<br>-<br>- ast_free(caller_name);<br>-       ast_free(connected_name);<br> <br>  return out;<br> }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8126">change 8126</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/8126"/><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: Ia06e0c065f1bd095781aa3f4a626d58fa4d28b38 </div>
<div style="display:none"> Gerrit-Change-Number: 8126 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Sean Bright <sean.bright@gmail.com> </div>