remove memleak when getting args

This commit is contained in:
Luna 2020-08-18 20:54:04 -03:00
parent 0cd47be7ac
commit 9527426d48

View file

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