aboutsummaryrefslogtreecommitdiffstats
path: root/cpio/test/test_option_lrzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpio/test/test_option_lrzip.c')
-rw-r--r--cpio/test/test_option_lrzip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpio/test/test_option_lrzip.c b/cpio/test/test_option_lrzip.c
index a84f75157a4c..8d9c0d576cc3 100644
--- a/cpio/test/test_option_lrzip.c
+++ b/cpio/test/test_option_lrzip.c
@@ -44,9 +44,10 @@ DEFINE_TEST(test_option_lrzip)
systemf("echo f | %s -o --lrzip >archive.out 2>archive.err",
testprog));
p = slurpfile(&s, "archive.err");
- p[s] = '\0';
+ free(p);
/* Check that the archive file has an lzma signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "LRZI\x00", 5);
+ free(p);
}