test/standalone/cat: fix leaks

This commit is contained in:
daurnimator
2020-09-27 15:06:27 +10:00
parent ed5c778c10
commit cffab89730

View File

@@ -13,6 +13,7 @@ pub fn main() !void {
var args_it = process.args();
const exe = try unwrapArg(args_it.next(allocator).?);
defer allocator.free(exe);
var catted_anything = false;
const stdout_file = io.getStdOut();
@@ -20,6 +21,7 @@ pub fn main() !void {
while (args_it.next(allocator)) |arg_or_err| {
const arg = try unwrapArg(arg_or_err);
defer allocator.free(arg);
if (mem.eql(u8, arg, "-")) {
catted_anything = true;
try cat_file(stdout_file, io.getStdIn());