summaryrefslogtreecommitdiff
path: root/main/json.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/json.c')
-rw-r--r--main/json.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/main/json.c b/main/json.c
index 8658502b3..5e50c424a 100644
--- a/main/json.c
+++ b/main/json.c
@@ -213,13 +213,15 @@ void ast_json_unref(struct ast_json *json)
struct json_mem_list *free_list;
struct json_mem *mem;
+ if (!json) {
+ return;
+ }
+
/* Jansson refcounting is non-atomic; lock it. */
{
SCOPED_JSON_LOCK(json);
- if (!json) {
- return;
- }
- json_decref((json_t *)json);
+
+ json_decref((json_t *) json);
}
/* Now free any objects that were ast_json_free()'s while the lock was