Stasis/ARI: Fix off-nominal path json memory leaks.

Change-Id: Id569c624c426e3b22a99936473c730592d8b83fb
This commit is contained in:
Richard Mudgett
2017-11-01 17:47:57 -05:00
parent 543d8ee388
commit 3bce5a9dfa
5 changed files with 15 additions and 2 deletions

View File

@@ -266,6 +266,7 @@ static struct ast_json *msg_to_json(struct ast_msg *msg)
json_vars = ast_json_array_create();
if (!json_vars) {
ast_msg_var_iterator_destroy(it_vars);
return NULL;
}
@@ -274,7 +275,8 @@ static struct ast_json *msg_to_json(struct ast_msg *msg)
json_tuple = ast_json_pack("{s: s}", name, value);
if (!json_tuple) {
ast_json_free(json_vars);
ast_json_unref(json_vars);
ast_msg_var_iterator_destroy(it_vars);
return NULL;
}