zig

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

commit 013c286e432eacbd55a9f842cd277be11f72cc49 (tree)
parent 73ba6bf30be02d65e19304b0ec45c9a2a495698e
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Thu, 30 Dec 2021 21:35:24 -0700

stage2: fix memory leak in addNonIncrementalStuffToCacheManifest

I accidentally used errdefer instead of defer for the function-local
arena.

Diffstat:
Msrc/Compilation.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Compilation.zig b/src/Compilation.zig @@ -2170,7 +2170,7 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes const target = comp.getTarget(); var arena_allocator = std.heap.ArenaAllocator.init(gpa); - errdefer arena_allocator.deinit(); + defer arena_allocator.deinit(); const arena = arena_allocator.allocator(); comptime assert(link_hash_implementation_version == 1);