mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Stasis/ARI: Fix off-nominal path json memory leaks.
Change-Id: Id569c624c426e3b22a99936473c730592d8b83fb
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user