From 5d7bdd80417c2be92af02f8f6dd7d2dbd32c410b Mon Sep 17 00:00:00 2001 From: utox39 Date: Tue, 29 Jul 2025 17:05:30 +0200 Subject: [PATCH 1/2] fix(linux-gpu): fix memory leak --- src/linux/hardware.zig | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/linux/hardware.zig b/src/linux/hardware.zig index 35fd8bd..4f4e168 100644 --- a/src/linux/hardware.zig +++ b/src/linux/hardware.zig @@ -145,7 +145,15 @@ pub fn getGpuInfo(allocator: std.mem.Allocator) !std.ArrayList(GpuInfo) { const gpu_name = try allocator.dupe(u8, std.mem.span(name)); - const parsed_gpu_name = try parseGpuName(allocator, gpu_name) orelse gpu_name; + const maybe_parsed_gpu_name = try parseGpuName(allocator, gpu_name); + var parsed_gpu_name: []u8 = undefined; + + if (maybe_parsed_gpu_name != null) { + allocator.free(gpu_name); + parsed_gpu_name = maybe_parsed_gpu_name.?; + } else { + parsed_gpu_name = gpu_name; + } try gpu_info_list.append(GpuInfo{ .gpu_name = parsed_gpu_name, From a866952f86ce8cbf705148be1b0b82bc09187024 Mon Sep 17 00:00:00 2001 From: utox39 Date: Tue, 29 Jul 2025 17:06:40 +0200 Subject: [PATCH 2/2] build: bump version to 0.7.4 --- build.zig.zon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.zig.zon b/build.zig.zon index 0ef4ac2..4cecf8b 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -10,7 +10,7 @@ // This is a [Semantic Version](https://semver.org/). // In a future version of Zig it will be used for package deduplication. - .version = "0.7.3", + .version = "0.7.4", // Together with name, this represents a globally unique package // identifier. This field is generated by the Zig toolchain when the