The json_val in api.c is a borrowed reference, not a new one so don't decref it.
diff --git a/api.c b/api.c
index e8aac16..7d45873 100644
--- a/api.c
+++ b/api.c
@@ -4589,7 +4589,6 @@ void api(int api_thr_id)
param = param_buf;
}
}
- json_decref(json_val);
}
json_decref(json_config);
}