authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-09-25 02:05:02-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-09-25 02:05:02-07:00
log480e3f89b227c6c1d5daeb8ae8f7af46c9301637
treed64ebc4cf10a4728a631649dc78266dc95e10f10
parentaaa314f6b2ff9481eba9d0cf72ed845c78f32c36

Maker.Fuzz: fix memory leaks


2 files changed, 6 insertions(+), 5 deletions(-)

lib/compiler/Maker/Fuzz.zig+1
......@@ -161,6 +161,7 @@ pub fn deinit(fuzz: *Fuzz) void {
161161 fuzz.group.cancel(io);
162162 fuzz.prog_node.end();
163163 gpa.free(fuzz.run_steps);
164 fuzz.msg_queue.deinit(gpa);
164165}
165166
166167fn rebuildTestsWorkerRun(
lib/compiler/Maker/Step/Run.zig+5-5
......@@ -18,14 +18,13 @@ const Step = @import("../Step.zig");
1818const Maker = @import("../../Maker.zig");
1919const Fuzz = @import("../../Maker/Fuzz.zig");
2020
21/// If this is a Zig unit test binary, this tracks the names of the unit
22/// tests that are also fuzz tests. Indexes cannot be used as they may
23/// change between reruns.
21/// If this is a Zig unit test binary, this tracks the names of the unit tests that are also fuzz tests.
22/// Indexes cannot be used as they may change between reruns. Memory owned by `Maker.gpa`.
2423fuzz_tests: std.ArrayList([]const u8) = .empty,
2524cached_test_metadata: ?CachedTestMetadata = null,
2625
27/// Populated during the fuzz phase if this run step corresponds to a unit test
28/// executable that contains fuzz tests.
26/// Populated during the fuzz phase if this run step corresponds to a unit test executable that contains fuzz
27/// tests. `Path.sub_path` owned by `Maker.gpa`.
2928rebuilt_executable: ?Path = null,
3029
3130pub fn make(
......@@ -376,6 +375,7 @@ pub fn make(
376375pub fn deinit(run: *Run, gpa: Allocator, io: Io) void {
377376 _ = io;
378377 run.fuzz_tests.deinit(gpa);
378 if (run.rebuilt_executable) |p| gpa.free(p.sub_path);
379379}
380380
381381fn thirdPartyToggle(