Skip to content

Commit 3974540

Browse files
Joost Doornbosalexrp
authored andcommitted
Fix memory leak in CObject.Diag.Bundle.destroy()
1 parent 549a466 commit 3974540

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Compilation.zig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,9 @@ pub const CObject = struct {
10261026

10271027
pub fn destroy(bundle: *Bundle, gpa: Allocator) void {
10281028
for (bundle.file_names.values()) |file_name| gpa.free(file_name);
1029+
bundle.file_names.deinit(gpa);
10291030
for (bundle.category_names.values()) |category_name| gpa.free(category_name);
1031+
bundle.category_names.deinit(gpa);
10301032
for (bundle.diags) |*diag| diag.deinit(gpa);
10311033
gpa.free(bundle.diags);
10321034
gpa.destroy(bundle);

0 commit comments

Comments
 (0)