summaryrefslogtreecommitdiffstats
path: root/linux
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-01-19 16:24:56 -0200
committerHisham Muhammad <hisham@gobolinux.org>2015-01-19 16:24:56 -0200
commit36b78328843d0dae0d0fadbd0e814a8a1546327c (patch)
tree943400f0050b2003fd58bf27565706ca2a361d60 /linux
parent430c7c9a9b2301fbe574cd9ca6919ed80d6f17a2 (diff)
Fix initialization of cpuData structure. Closes #159.
Diffstat (limited to 'linux')
-rw-r--r--linux/LinuxProcessList.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
index 0b46d119..d4c536a0 100644
--- a/linux/LinuxProcessList.c
+++ b/linux/LinuxProcessList.c
@@ -63,7 +63,7 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList) {
fclose(file);
this->cpuCount = MAX(cpus - 1, 1);
- this->cpus = realloc(this->cpus, cpus * sizeof(CPUData));
+ this->cpus = calloc(cpus, sizeof(CPUData));
for (int i = 0; i < cpus; i++) {
this->cpus[i].totalTime = 1;