fix(linux-packages): fix a memory leak caused by the child process writing to stderr

This commit is contained in:
utox39
2025-12-09 12:26:35 +01:00
parent 51de84d210
commit e2cbda50c1

View File

@@ -10,6 +10,7 @@ fn countFlatpakPackages(allocator: std.mem.Allocator) !usize {
const result_stdout = result.stdout;
const result_trimmed = std.mem.trim(u8, result_stdout, "\n");
defer allocator.free(result_stdout);
defer allocator.free(result.stderr);
return try std.fmt.parseInt(usize, result_trimmed, 10);
}
@@ -25,6 +26,7 @@ fn countNixPackages(allocator: std.mem.Allocator) !usize {
const result_stdout = result.stdout;
const result_trimmed = std.mem.trim(u8, result_stdout, "\n");
defer allocator.free(result_stdout);
defer allocator.free(result.stderr);
return try std.fmt.parseInt(usize, result_trimmed, 10);
}