aboutsummaryrefslogtreecommitdiffstats
path: root/cpio/test/test_option_lz4.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpio/test/test_option_lz4.c')
-rw-r--r--cpio/test/test_option_lz4.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cpio/test/test_option_lz4.c b/cpio/test/test_option_lz4.c
index afd683ddc773..88dfbd63bae9 100644
--- a/cpio/test/test_option_lz4.c
+++ b/cpio/test/test_option_lz4.c
@@ -43,6 +43,7 @@ DEFINE_TEST(test_option_lz4)
if (strstr(p, "compression not available") != NULL) {
skipping("This version of bsdcpio was compiled "
"without lz4 support");
+ free(p);
return;
}
/* POSIX permits different handling of the spawnp
@@ -52,6 +53,7 @@ DEFINE_TEST(test_option_lz4)
if (strstr(p, "Can't launch") != NULL && !canLz4()) {
skipping("This version of bsdcpio uses an external lz4 program "
"but no such program is available on this system.");
+ free(p);
return;
}
/* Some systems successfully spawn the new process,
@@ -61,6 +63,7 @@ DEFINE_TEST(test_option_lz4)
if (strstr(p, "Can't write") != NULL && !canLz4()) {
skipping("This version of bsdcpio uses an external lz4 program "
"but no such program is available on this system.");
+ free(p);
return;
}
/* On some systems the error won't be detected until closing
@@ -68,14 +71,18 @@ DEFINE_TEST(test_option_lz4)
if (strstr(p, "Error closing") != NULL && !canLz4()) {
skipping("This version of bsdcpio uses an external lz4 program "
"but no such program is available on this system.");
+ free(p);
return;
}
+ free(p);
failure("--lz4 option is broken: %s", p);
assertEqualInt(r, 0);
return;
}
+ free(p);
/* Check that the archive file has an lz4 signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "\x04\x22\x4d\x18", 4);
+ free(p);
}