From 64fb7181ee4fa4d0f2a22d202d33971899b53f08 Mon Sep 17 00:00:00 2001 From: er-azh <80633916+er-azh@users.noreply.github.com> Date: Sun, 27 Mar 2022 12:23:56 +0430 Subject: [PATCH] use xCalloc for allocating cpuData --- linux/LinuxProcessList.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 67493cd0..f365ff21 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -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;