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().
This commit is contained in:
Manlio Perillo 2023-01-13 15:20:00 +01:00
parent 7cb2f9222d
commit c5351a8d49

View File

@ -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| {