From c5351a8d496edd7d76b3fc505f3e078b9e00982e Mon Sep 17 00:00:00 2001 From: Manlio Perillo Date: Fri, 13 Jan 2023 15:20:00 +0100 Subject: [PATCH] docgen: remove unnecessary and incorrect deallocations The deallocations of the process arguments are unnecessary, since the memory will be deallocated by arena.deinit(). The deallocations are incorrect, since ArgIterator.next() returns a slice pointing to the iterator's internal buffer, that should be deallocated with args_it.deinit(). --- doc/docgen.zig | 5 ----- 1 file changed, 5 deletions(-) diff --git a/doc/docgen.zig b/doc/docgen.zig index 4057a52f07..1421e5b555 100644 --- a/doc/docgen.zig +++ b/doc/docgen.zig @@ -28,13 +28,8 @@ pub fn main() !void { if (!args_it.skip()) @panic("expected self arg"); const zig_exe = args_it.next() orelse @panic("expected zig exe arg"); - defer allocator.free(zig_exe); - const in_file_name = args_it.next() orelse @panic("expected input arg"); - defer allocator.free(in_file_name); - const out_file_name = args_it.next() orelse @panic("expected output arg"); - defer allocator.free(out_file_name); var do_code_tests = true; if (args_it.next()) |arg| {