macho: do not close file on error - it will happen automatically anyhow

This commit is contained in:
Jakub Konka 2024-02-08 23:50:09 +01:00
parent 32386a06ca
commit 8c0e5435b3

View File

@ -957,7 +957,6 @@ fn parseObject(self: *MachO, path: []const u8) ParseError!void {
const gpa = self.base.comp.gpa;
const file = try std.fs.cwd().openFile(path, .{});
errdefer file.close();
const handle = try self.addFileHandle(file);
const mtime: u64 = mtime: {
const stat = file.stat() catch break :mtime 0;
@ -994,7 +993,6 @@ fn parseArchive(self: *MachO, lib: SystemLib, must_link: bool, fat_arch: ?fat.Ar
const gpa = self.base.comp.gpa;
const file = try std.fs.cwd().openFile(lib.path, .{});
errdefer file.close();
const handle = try self.addFileHandle(file);
var archive = Archive{};