diff options
| author | daurnimator <quae@daurnimator.com> | 2020-09-27 15:06:27 +1000 |
|---|---|---|
| committer | daurnimator <quae@daurnimator.com> | 2020-09-27 15:06:31 +1000 |
| commit | cffab89730eb6f4183e2628d8b0d007df809436a (patch) | |
| tree | b32432c6278ace871bb5b6c704378f13db02f04b | |
| parent | ed5c778c103ceba5f0121d441598e160a5af643e (diff) | |
| download | zig-cffab89730eb6f4183e2628d8b0d007df809436a.tar.gz zig-cffab89730eb6f4183e2628d8b0d007df809436a.zip | |
test/standalone/cat: fix leaks
| -rw-r--r-- | test/standalone/cat/main.zig | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/standalone/cat/main.zig b/test/standalone/cat/main.zig index 6678cfd1ab..58b87f76f3 100644 --- a/test/standalone/cat/main.zig +++ b/test/standalone/cat/main.zig @@ -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()); |
