From 5f80103605bdf401d20d6a62bee9a80a366a94b6 Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Sun, 1 May 2016 21:35:05 +0300 Subject: [PATCH] fix for invalid JSON generation #329, #347 --- src/sys_fs_cgroup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sys_fs_cgroup.c b/src/sys_fs_cgroup.c index 42547154..38fddcda 100644 --- a/src/sys_fs_cgroup.c +++ b/src/sys_fs_cgroup.c @@ -614,13 +614,15 @@ void cgroup_get_chart_id(struct cgroup *cg) { if(!cg->chart_title) fatal("CGROUP: Cannot allocate memory for chart name of cgroup '%s' chart name: '%s'", cg->id, s); - netdata_fix_chart_id(s); + netdata_fix_chart_name(cg->chart_title); free(cg->chart_id); cg->chart_id = strdup(s); if(!cg->chart_id) fatal("CGROUP: Cannot allocate memory for chart id of cgroup '%s' chart id: '%s'", cg->id, s); + netdata_fix_chart_id(cg->chart_id); + debug(D_CGROUP, "cgroup '%s' renamed to '%s' (title: '%s')", cg->id, cg->chart_id, cg->chart_title); } else debug(D_CGROUP, "cgroup '%s' is not to be renamed (will be shown as '%s')", cg->id, cg->chart_id); -- 2.39.2