Skip to content
Snippets Groups Projects
Commit 15d3c5f3 authored by Joshua Colp's avatar Joshua Colp Committed by Gerrit Code Review
Browse files

Merge "stasis_bridges.c: Fix off-nominal json memory leaks."

parents 5f5c3cfa 92342401
No related branches found
No related tags found
No related merge requests found
......@@ -868,6 +868,8 @@ static struct ast_json *attended_transfer_to_json(struct stasis_message *msg,
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;
}
}
......@@ -875,6 +877,9 @@ static struct ast_json *attended_transfer_to_json(struct stasis_message *msg,
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;
}
}
......@@ -887,9 +892,12 @@ static struct ast_json *attended_transfer_to_json(struct stasis_message *msg,
"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)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment