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 325b5dd30f
commit 79ddcdbc70
5 changed files with 15 additions and 2 deletions

View File

@@ -264,6 +264,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;
}
@@ -272,7 +273,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;
}