authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-12-16 13:48:43-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-01-01 17:51:20-07:00
logb1fc3fe1c42d50a40eee985f059a4f43a5f1ce1a
treeee7f4f15bb709ae5d4c701403430aeabd442243f
parente3409c0bce4a0aaa2ec3f536eabf31061919dde4

Elf: fix invalid free of path field

It's now arena-allocated so no need to free it with gpa

1 files changed, 1 insertions(+), 1 deletions(-)

src/link/Elf/ZigObject.zig+1-1
......@@ -4,6 +4,7 @@
44//! Think about this as fake in-memory Object file for the Zig module.
55
66data: std.ArrayListUnmanaged(u8) = .{},
7/// Externally owned memory.
78path: []const u8,
89index: File.Index,
910
......@@ -109,7 +110,6 @@ pub fn init(self: *ZigObject, elf_file: *Elf) !void {
109110
110111pub fn deinit(self: *ZigObject, allocator: Allocator) void {
111112 self.data.deinit(allocator);
112 allocator.free(self.path);
113113 self.local_esyms.deinit(allocator);
114114 self.global_esyms.deinit(allocator);
115115 self.strtab.deinit(allocator);