From f0a16b1cbce55a550685d6300f9ca8f0bee6980c Mon Sep 17 00:00:00 2001 From: Ronald Date: Sun, 1 Sep 2024 17:08:52 +0100 Subject: [PATCH] Fix memory leaks --- systeminfo_linux.odin | 2 ++ 1 file changed, 2 insertions(+) diff --git a/systeminfo_linux.odin b/systeminfo_linux.odin index 5a4a811..0073c0e 100644 --- a/systeminfo_linux.odin +++ b/systeminfo_linux.odin @@ -224,6 +224,7 @@ get_cpu_usage_perc :: proc() -> (f64, bool) { fmt.fprintln(os.stderr, "Issue whilst passing /proc/stat") return 0, false } + defer delete(data) data_str := string(data) @@ -245,6 +246,7 @@ get_cpu_usage_perc :: proc() -> (f64, bool) { fmt.fprintln(os.stderr, "Issue whilst passing /proc/stat") return 0, false } + defer delete(data) data_str = string(data)