Fix initialization of cpuData structure. Closes #159.

This commit is contained in:
Hisham Muhammad 2015-01-19 16:24:56 -02:00
parent 430c7c9a9b
commit 36b7832884
1 changed files with 1 additions and 1 deletions

View File

@ -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;