summaryrefslogtreecommitdiffstats
path: root/collectors/proc.plugin/proc_stat.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-03-16 07:50:45 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-03-16 07:50:45 +0000
commit87cce1817d03daca8c31be82d781ec47a4560087 (patch)
tree06cb3e407ea32dcc385cbe4fb77e251e34bc1e68 /collectors/proc.plugin/proc_stat.c
parentReleasing debian version 1.12.2-2. (diff)
downloadnetdata-87cce1817d03daca8c31be82d781ec47a4560087.tar.xz
netdata-87cce1817d03daca8c31be82d781ec47a4560087.zip
Merging upstream version 1.13.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/proc.plugin/proc_stat.c')
-rw-r--r--collectors/proc.plugin/proc_stat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/collectors/proc.plugin/proc_stat.c b/collectors/proc.plugin/proc_stat.c
index ad893456b..f98b09561 100644
--- a/collectors/proc.plugin/proc_stat.c
+++ b/collectors/proc.plugin/proc_stat.c
@@ -404,8 +404,8 @@ static int read_cpuidle_states(char *cpuidle_name_filename , char *cpuidle_time_
}
snprintfz(next_state_filename, FILENAME_MAX, cpuidle_name_filename, core, cc->cpuidle_state_len);
- cc->cpuidle_state = callocz(cc->cpuidle_state_len, sizeof(struct cpuidle_state));
- memset(cc->cpuidle_state, 0, sizeof(struct cpuidle_state) * cc->cpuidle_state_len);
+ if(likely(cc->cpuidle_state_len))
+ cc->cpuidle_state = callocz(cc->cpuidle_state_len, sizeof(struct cpuidle_state));
for(state = 0; state < cc->cpuidle_state_len; state++) {
char name_buf[50 + 1];