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 13:59:27-08:00
loga2582df5b2cbf96823a239624857461fe65433f3
tree121e705db32acd17db707bba6a7e05b967ac05ab
parent0c520cd32df1dd38fdedf2ace388b465fab69b80

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