mirror of
https://github.com/ziglang/zig.git
synced 2026-02-19 15:58:50 +00:00
macho+zld: properly deinit code signature object
This commit is contained in:
parent
2cb6db2219
commit
22b39f034b
@ -574,11 +574,12 @@ pub fn flushModule(self: *MachO, comp: *Compilation, prog_node: *std.Progress.No
|
||||
var codesig = CodeSignature.init(self.page_size);
|
||||
codesig.code_directory.ident = self.base.options.emit.?.sub_path;
|
||||
if (self.base.options.entitlements) |path| {
|
||||
try codesig.addEntitlements(arena, path);
|
||||
try codesig.addEntitlements(self.base.allocator, path);
|
||||
}
|
||||
try self.writeCodeSignaturePadding(&codesig);
|
||||
break :blk codesig;
|
||||
} else null;
|
||||
defer if (codesig) |*csig| csig.deinit(self.base.allocator);
|
||||
|
||||
// Write load commands
|
||||
var lc_buffer = std.ArrayList(u8).init(arena);
|
||||
|
||||
@ -4115,11 +4115,12 @@ pub fn linkWithZld(macho_file: *MachO, comp: *Compilation, prog_node: *std.Progr
|
||||
var codesig = CodeSignature.init(page_size);
|
||||
codesig.code_directory.ident = fs.path.basename(full_out_path);
|
||||
if (options.entitlements) |path| {
|
||||
try codesig.addEntitlements(arena, path);
|
||||
try codesig.addEntitlements(zld.gpa, path);
|
||||
}
|
||||
try zld.writeCodeSignaturePadding(&codesig);
|
||||
break :blk codesig;
|
||||
} else null;
|
||||
defer if (codesig) |*csig| csig.deinit(zld.gpa);
|
||||
|
||||
// Write load commands
|
||||
var lc_buffer = std.ArrayList(u8).init(arena);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user