<p>Richard Mudgett has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7022">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stasis_bridges.c: Fix off-nominal json memory leaks.<br><br>Change-Id: Ib1181a36b317c86bff1ef2e44a17a0b1c73cfdc8<br>---<br>M main/stasis_bridges.c<br>1 file changed, 8 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/22/7022/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/stasis_bridges.c b/main/stasis_bridges.c<br>index 8f97e98..413c9be 100644<br>--- a/main/stasis_bridges.c<br>+++ b/main/stasis_bridges.c<br>@@ -857,6 +857,8 @@<br> if (transfer_msg->transferee) {<br> json_transferee = ast_channel_snapshot_to_json(transfer_msg->transferee, sanitize);<br> if (!json_transferee) {<br>+ ast_json_unref(json_transferer2);<br>+ ast_json_unref(json_transferer1);<br> return NULL;<br> }<br> }<br>@@ -864,6 +866,9 @@<br> if (transfer_msg->target) {<br> json_target = ast_channel_snapshot_to_json(transfer_msg->target, sanitize);<br> if (!json_target) {<br>+ ast_json_unref(json_transferee);<br>+ ast_json_unref(json_transferer2);<br>+ ast_json_unref(json_transferer1);<br> return NULL;<br> }<br> }<br>@@ -876,9 +881,12 @@<br> "result", result_strs[transfer_msg->result],<br> "is_external", ast_json_boolean(transfer_msg->is_external));<br> if (!out) {<br>+ ast_json_unref(json_target);<br>+ ast_json_unref(json_transferee);<br> return NULL;<br> }<br> if (json_transferee && ast_json_object_set(out, "transferee", json_transferee)) {<br>+ ast_json_unref(json_target);<br> return NULL;<br> }<br> if (json_target && ast_json_object_set(out, "transfer_target", json_target)) {<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7022">change 7022</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/7022"/><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: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ib1181a36b317c86bff1ef2e44a17a0b1c73cfdc8 </div>
<div style="display:none"> Gerrit-Change-Number: 7022 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@digium.com> </div>