mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
wasm-linker: Fix memory leak
This fixes a memory leak when an object file contains one or more element sections which then contains one or more function indexes. This commit ensures the slice of index functions for each element section will be freed upon resource deallocation also.
This commit is contained in:
parent
2635e4ca6e
commit
321a164269
@ -133,6 +133,9 @@ pub fn deinit(self: *Object, gpa: Allocator) void {
|
||||
gpa.free(self.memories);
|
||||
gpa.free(self.globals);
|
||||
gpa.free(self.exports);
|
||||
for (self.elements) |el| {
|
||||
gpa.free(el.func_indexes);
|
||||
}
|
||||
gpa.free(self.elements);
|
||||
gpa.free(self.features);
|
||||
for (self.relocations.values()) |val| {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user