mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 21:08:36 +00:00
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:
parent
7cb2f9222d
commit
c5351a8d49
@ -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| {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user