remove memleak when getting args

This commit is contained in:
Luna 2020-08-18 20:54:04 -03:00
parent 0cd47be7ac
commit 9527426d48
1 changed files with 2 additions and 2 deletions

View File

@ -242,9 +242,9 @@ pub fn main() !void {
var args_it = std.process.args();
// TODO print help
_ = try (args_it.next(allocator) orelse @panic("expected exe name"));
_ = args_it.skip();
const scri_path = try (args_it.next(allocator) orelse @panic("expected scri path or 'repl'"));
defer allocator.free(scri_path);
if (std.mem.eql(u8, scri_path, "repl")) {
return try doRepl(allocator, &args_it);