mirror of
https://github.com/ziglang/zig.git
synced 2026-01-11 01:45:12 +00:00
stage2: fix memory leak in the cbe
This commit is contained in:
parent
30ffa052f2
commit
d9e46a4b90
@ -92,6 +92,12 @@ pub fn updateDecl(self: *C, module: *Module, decl: *Module.Decl) !void {
|
||||
const typedefs = &decl.fn_link.c.typedefs;
|
||||
const code = &decl.link.c.code;
|
||||
fwd_decl.shrinkRetainingCapacity(0);
|
||||
{
|
||||
var it = typedefs.iterator();
|
||||
while (it.next()) |entry| {
|
||||
module.gpa.free(entry.value.rendered);
|
||||
}
|
||||
}
|
||||
typedefs.clearRetainingCapacity();
|
||||
code.shrinkRetainingCapacity(0);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user