use xCalloc for allocating cpuData

This commit is contained in:
er-azh 2022-03-27 12:23:56 +04:30
parent ba4c67942c
commit 64fb7181ee
No known key found for this signature in database
GPG Key ID: 933E21B9BA43FAAB
1 changed files with 1 additions and 1 deletions

View File

@ -176,7 +176,7 @@ static void LinuxProcessList_updateCPUcount(ProcessList* super) {
// Initialize the cpuData array before anything else.
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[1].online = true;
super->activeCPUs = 1;