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:
@@ -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| {
|
||||
|
||||
Reference in New Issue
Block a user