Commit 013c286e43

Andrew Kelley <andrew@ziglang.org>
2021-12-31 05:35:24
stage2: fix memory leak in addNonIncrementalStuffToCacheManifest
I accidentally used errdefer instead of defer for the function-local arena.
1 parent 73ba6bf
Changed files (1)
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);