aboutsummaryrefslogtreecommitdiffstats
path: root/cpio/test/test_option_y.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpio/test/test_option_y.c')
-rw-r--r--cpio/test/test_option_y.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/cpio/test/test_option_y.c b/cpio/test/test_option_y.c
index 0397b3d1bf45..989b5f1aaf6e 100644
--- a/cpio/test/test_option_y.c
+++ b/cpio/test/test_option_y.c
@@ -38,7 +38,7 @@ DEFINE_TEST(test_option_y)
r = systemf("echo f | %s -oy >archive.out 2>archive.err",
testprog);
p = slurpfile(&s, "archive.err");
- p[s] = '\0';
+ free(p);
if (r != 0) {
if (!canBzip2()) {
skipping("bzip2 is not supported on this platform");
@@ -46,14 +46,12 @@ DEFINE_TEST(test_option_y)
}
failure("-y option is broken");
assertEqualInt(r, 0);
- goto done;
+ return;
}
assertTextFileContents("1 block\n", "archive.err");
/* Check that the archive file has a bzip2 signature. */
- free(p);
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "BZh9", 4);
-done:
free(p);
}