From: Vincent Guittot vincent.guittot@linaro.org
don't rely on json object data
Signed-off-by: Vincent Guittot vincent.guittot@linaro.org --- src/rt-app_parse_config.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/rt-app_parse_config.c b/src/rt-app_parse_config.c index cd0ddcd..fc404d6 100644 --- a/src/rt-app_parse_config.c +++ b/src/rt-app_parse_config.c @@ -407,8 +407,7 @@ parse_thread_data(char *name, struct json_object *obj, int idx, cpuset_obj = get_in_object(obj, "cpus", TRUE); if (cpuset_obj) { assure_type_is(cpuset_obj, obj, "cpus", json_type_array); - data->cpuset_str = json_object_to_json_string(cpuset_obj); - log_info(PIN "key: cpus %s", data->cpuset_str); + data->cpuset_str = strdup(json_object_to_json_string(cpuset_obj)); data->cpuset = malloc(sizeof(cpu_set_t)); cpuset = json_object_get_array(cpuset_obj); CPU_ZERO(data->cpuset); @@ -420,8 +419,8 @@ parse_thread_data(char *name, struct json_object *obj, int idx, } else { data->cpuset_str = strdup("-"); data->cpuset = NULL; - log_info(PIN "key: cpus %s", data->cpuset_str); } + log_info(PIN "key: cpus %s", data->cpuset_str);
/* resources */ resources = get_in_object(obj, "resources", TRUE);