void _kds_s2000w_handler_opts_set_options(handler_t* h)
{
- const char* json_string = json_object_to_json_string_ext(h->scanner_config, JSON_C_TO_STRING_PLAIN);
+ json_object* config = json_object_new_object();
+ json_object* config_value = NULL;
+ json_object_deep_copy(h->scanner_config, &config_value, json_c_shallow_copy_default);
+ json_object_object_add(config, CONFIGURATION, config_value);
+ const char* json_string = json_object_to_json_string_ext(config, JSON_C_TO_STRING_PLAIN);
response_t* resp = kds_s2000w_client_response_init();
resp->size = sizeof(char) * strlen(json_string);
resp->code = 0;
kds_s2000w_client_response_free(resp);
resp = NULL;
+ json_object_put(config);
+ config = NULL;
}
void _kds_s2000w_handler_opts_load_config(handler_t* h)