diff options
-rw-r--r-- | src/rest.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -2445,9 +2445,14 @@ static int og_cmd_scope_get(json_t *element, struct og_msg_params *params, }; root = json_object(); + if (!root) + return -1; + children_root = json_array(); - if (!root || !children_root) + if (!children_root) { + json_decref(root); return -1; + } json_object_set(root, "scope", children_root); |