authorgravatar for ascottcameron@gmail.comAlex Cameron <ascottcameron@gmail.com> 2020-11-08 17:51:19+11:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-16 15:00:22-07:00
log5b42704ea7b8d724330ba8fd5f8631a1f1aab4ce
treeb4774b625052308cce4164806da1208d810ffadd
parentc8b6e407baa30b41693301fcbf0a17bd3432619b

Prevent double file close in MachO linking


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

src/link/MachO.zig+4-1
...@@ -256,7 +256,10 @@ pub fn openPath(allocator: *Allocator, sub_path: []const u8, options: link.Optio...@@ -256,7 +256,10 @@ pub fn openPath(allocator: *Allocator, sub_path: []const u8, options: link.Optio
256 errdefer file.close();256 errdefer file.close();
257257
258 const self = try createEmpty(allocator, options);258 const self = try createEmpty(allocator, options);
259 errdefer self.base.destroy();259 errdefer {
260 self.base.file = null;
261 self.base.destroy();
262 }
260263
261 self.base.file = file;264 self.base.file = file;
262265