mirror of https://github.com/xzeldon/htop.git
use xCalloc for allocating cpuData
This commit is contained in:
parent
ba4c67942c
commit
64fb7181ee
|
@ -176,7 +176,7 @@ static void LinuxProcessList_updateCPUcount(ProcessList* super) {
|
||||||
|
|
||||||
// Initialize the cpuData array before anything else.
|
// Initialize the cpuData array before anything else.
|
||||||
if (!this->cpuData) {
|
if (!this->cpuData) {
|
||||||
this->cpuData = xReallocArrayZero(this->cpuData, super->existingCPUs ? (super->existingCPUs + 1) : 0, 2, sizeof(CPUData));
|
this->cpuData = xCalloc(2, sizeof(CPUData));
|
||||||
this->cpuData[0].online = true; /* average is always "online" */
|
this->cpuData[0].online = true; /* average is always "online" */
|
||||||
this->cpuData[1].online = true;
|
this->cpuData[1].online = true;
|
||||||
super->activeCPUs = 1;
|
super->activeCPUs = 1;
|
||||||
|
|
Loading…
Reference in New Issue