From 2c8c1166d81a5c0fe6f335742ee24319ce60bfa8 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 26 Apr 2023 00:54:48 -0400 Subject: Use static storage * Almost everything returned by the system is immutable * Fixed block_device array initialization and alphabetical sorting * Free memory where possible --- darwin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'darwin.c') diff --git a/darwin.c b/darwin.c index 843ee93..4a5986b 100644 --- a/darwin.c +++ b/darwin.c @@ -2,12 +2,12 @@ #include "common.h" char *get_sys_product_darwin() { - char model[100] = {0}; + static char model[100] = {0}; size_t len; len = sizeof(model); sysctlbyname("hw.model", model, &len, NULL, 0); - return strdup(model); + return model; } ssize_t get_sys_memory() { -- cgit