diff --git a/src/detection/memory/memory_apple.c b/src/detection/memory/memory_apple.c index 8124e7265..235b13443 100644 --- a/src/detection/memory/memory_apple.c +++ b/src/detection/memory/memory_apple.c @@ -6,7 +6,7 @@ static void detectRam(FFMemoryStorage* ram) { - memory->ram.bytesTotal = (uint64_t) ffSysctlGetInt64("hw.memsize", 0); + ram->bytesTotal = (uint64_t) ffSysctlGetInt64("hw.memsize", 0); if(ram->bytesTotal == 0) { ffStrbufAppendS(&ram->error, "Failed to read hw.memsize"); @@ -28,21 +28,21 @@ static void detectRam(FFMemoryStorage* ram) return; } - memory->ram.bytesUsed = ((uint64_t) vmstat.active_count + vmstat.wire_count) * pagesize; + ram->bytesUsed = ((uint64_t) vmstat.active_count + vmstat.wire_count) * pagesize; } static void detectSwap(FFMemoryStorage* swap) { - struct xsw_usage swap; - size_t size = sizeof(swap); - if(sysctlbyname("vm.swapusage", &swap, &size, 0, 0) != 0) + struct xsw_usage xsw; + size_t size = sizeof(xsw); + if(sysctlbyname("vm.swapusage", &xsw, &size, 0, 0) != 0) { ffStrbufAppendS(&swap->error, "Failed to read vm.swapusage"); return; } - memory->swap.bytesTotal = swap.xsu_total; - memory->swap.bytesUsed = swap.xsu_used; + swap->bytesTotal = xsw.xsu_total; + swap->bytesUsed = xsw.xsu_used; } void ffDetectMemoryImpl(FFMemoryResult* memory)