aboutsummaryrefslogtreecommitdiff
path: root/test/tests.zig
diff options
context:
space:
mode:
authorJonathan Marler <johnnymarler@gmail.com>2020-06-03 15:55:18 -0600
committerAndrew Kelley <andrew@ziglang.org>2020-06-09 00:17:22 -0400
commit12051b02f1f455b85d5a519dd1747a67d4bb68d0 (patch)
tree4b773a1821e7b375e72734969918859d8aba5764 /test/tests.zig
parent9ee98f103b3c8eb7f5775943725af4d38da36d2c (diff)
downloadzig-12051b02f1f455b85d5a519dd1747a67d4bb68d0.tar.gz
zig-12051b02f1f455b85d5a519dd1747a67d4bb68d0.zip
fix memory errors
Diffstat (limited to 'test/tests.zig')
-rw-r--r--test/tests.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/tests.zig b/test/tests.zig
index 577f48b03a..0cf5ec28dd 100644
--- a/test/tests.zig
+++ b/test/tests.zig
@@ -648,8 +648,9 @@ pub const StackTracesContext = struct {
const stdout = child.stdout.?.inStream().readAllAlloc(b.allocator, max_stdout_size) catch unreachable;
defer b.allocator.free(stdout);
- var stderr = child.stderr.?.inStream().readAllAlloc(b.allocator, max_stdout_size) catch unreachable;
- defer b.allocator.free(stderr);
+ const stderrFull = child.stderr.?.inStream().readAllAlloc(b.allocator, max_stdout_size) catch unreachable;
+ defer b.allocator.free(stderrFull);
+ var stderr = stderrFull;
const term = child.wait() catch |err| {
debug.panic("Unable to spawn {}: {}\n", .{ full_exe_path, @errorName(err) });