[Asterisk-code-review] stasis bridges.c: Fix off-nominal json memory leaks. (asterisk[13])
Jenkins2
asteriskteam at digium.com
Thu Nov 9 17:44:16 CST 2017
Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/7022 )
Change subject: stasis_bridges.c: Fix off-nominal json memory leaks.
......................................................................
stasis_bridges.c: Fix off-nominal json memory leaks.
Change-Id: Ib1181a36b317c86bff1ef2e44a17a0b1c73cfdc8
---
M main/stasis_bridges.c
1 file changed, 8 insertions(+), 0 deletions(-)
Approvals:
Corey Farrell: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved
Jenkins2: Approved for Submit
diff --git a/main/stasis_bridges.c b/main/stasis_bridges.c
index 8f97e98..413c9be 100644
--- a/main/stasis_bridges.c
+++ b/main/stasis_bridges.c
@@ -857,6 +857,8 @@
if (transfer_msg->transferee) {
json_transferee = ast_channel_snapshot_to_json(transfer_msg->transferee, sanitize);
if (!json_transferee) {
+ ast_json_unref(json_transferer2);
+ ast_json_unref(json_transferer1);
return NULL;
}
}
@@ -864,6 +866,9 @@
if (transfer_msg->target) {
json_target = ast_channel_snapshot_to_json(transfer_msg->target, sanitize);
if (!json_target) {
+ ast_json_unref(json_transferee);
+ ast_json_unref(json_transferer2);
+ ast_json_unref(json_transferer1);
return NULL;
}
}
@@ -876,9 +881,12 @@
"result", result_strs[transfer_msg->result],
"is_external", ast_json_boolean(transfer_msg->is_external));
if (!out) {
+ ast_json_unref(json_target);
+ ast_json_unref(json_transferee);
return NULL;
}
if (json_transferee && ast_json_object_set(out, "transferee", json_transferee)) {
+ ast_json_unref(json_target);
return NULL;
}
if (json_target && ast_json_object_set(out, "transfer_target", json_target)) {
--
To view, visit https://gerrit.asterisk.org/7022
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib1181a36b317c86bff1ef2e44a17a0b1c73cfdc8
Gerrit-Change-Number: 7022
Gerrit-PatchSet: 1
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171109/0f1f0d8c/attachment.html>
More information about the asterisk-code-review
mailing list