aboutsummaryrefslogtreecommitdiffstats
path: root/cpio/test/test_option_lzop.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpio/test/test_option_lzop.c')
-rw-r--r--cpio/test/test_option_lzop.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpio/test/test_option_lzop.c b/cpio/test/test_option_lzop.c
index 9f1666e9c5b9..aa40ef5b6392 100644
--- a/cpio/test/test_option_lzop.c
+++ b/cpio/test/test_option_lzop.c
@@ -39,7 +39,7 @@ DEFINE_TEST(test_option_lzop)
r = systemf("echo f | %s -o --lzop >archive.out 2>archive.err",
testprog);
p = slurpfile(&s, "archive.err");
- p[s] = '\0';
+ free(p);
if (r != 0) {
if (!canLzop()) {
skipping("lzop is not supported on this platform");
@@ -53,4 +53,5 @@ DEFINE_TEST(test_option_lzop)
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a", 9);
+ free(p);
}