- obj = json_object();
- if (obj == NULL) {
- throw new std::bad_alloc;
- }
-
- /* FIXME check json_object_set_new return value */
- json_object_set_new(obj, "version", json_integer(1));
- json_object_set_new(obj, "flags", json_integer(m_flags));
-
- sources = json_object();
- if (sources == NULL) {
- json_decref(obj);
- throw new std::bad_alloc;
- }