zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 5b022623cf7059b76d3bbc91c71a93ab96adbdeb (tree)
parent f3dd10d40fb9b6b94ccf7729c728c80ebd608ba7
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Mon, 25 May 2026 20:17:41 -0700

Maker.Step.Compile: fix memory leak in checkCompileErrors

Diffstat:
Mlib/compiler/Maker/Step/Compile.zig | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/compiler/Maker/Step/Compile.zig b/lib/compiler/Maker/Step/Compile.zig @@ -991,8 +991,9 @@ fn checkCompileErrors(arena: Allocator, maker: *Maker, step_index: Configuration const conf_comp = conf_step.extended.get(conf.extra).compile; // Clear this field so that it does not get printed by the build runner. - const actual_eb = step.result_error_bundle; + var actual_eb = step.result_error_bundle; step.result_error_bundle = .empty; + defer actual_eb.deinit(maker.gpa); const actual_errors = ae: { var aw: std.Io.Writer.Allocating = .init(arena);