From 42ed34d1f6a1f6487981749eb6c31deba198aa67 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Thu, 21 Apr 2022 12:04:27 +0200 Subject: [PATCH] macho: create LlvmObject in createEmpty only Prior to this change we would also create it in `openPath`, but as `openPath` internally calls `createEmpty` we would end up with a memory leak. --- src/link/MachO.zig | 1 - 1 file changed, 1 deletion(-) diff --git a/src/link/MachO.zig b/src/link/MachO.zig index 52ffba954d..7caccb1fb8 100644 --- a/src/link/MachO.zig +++ b/src/link/MachO.zig @@ -321,7 +321,6 @@ pub fn openPath(allocator: Allocator, options: link.Options) !*MachO { // TODO this intermediary_basename isn't enough; in the case of `zig build-exe`, // we also want to put the intermediary object file in the cache while the // main emit directory is the cwd. - self.llvm_object = try LlvmObject.create(allocator, options); self.base.intermediary_basename = try std.fmt.allocPrint(allocator, "{s}{s}", .{ emit.sub_path, options.object_format.fileExt(options.target.cpu.arch), });