diff options
Diffstat (limited to 'bin/tar2sqfs')
-rw-r--r-- | bin/tar2sqfs/process_tarball.c | 2 | ||||
-rw-r--r-- | bin/tar2sqfs/tar2sqfs.c | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/bin/tar2sqfs/process_tarball.c b/bin/tar2sqfs/process_tarball.c index c0ae5a3..6aaa24b 100644 --- a/bin/tar2sqfs/process_tarball.c +++ b/bin/tar2sqfs/process_tarball.c @@ -72,7 +72,7 @@ static int write_file(istream_t *input_file, sqfs_writer_t *sqfs, } ostream_flush(out); - sqfs_destroy(out); + sqfs_drop(out); if (ret) return -1; diff --git a/bin/tar2sqfs/tar2sqfs.c b/bin/tar2sqfs/tar2sqfs.c index 4e9ade9..572eb10 100644 --- a/bin/tar2sqfs/tar2sqfs.c +++ b/bin/tar2sqfs/tar2sqfs.c @@ -50,6 +50,8 @@ int main(int argc, char **argv) goto out_if; if (ret > 0) { + istream_t *strm; + if (!io_compressor_exists(ret)) { fprintf(stderr, "%s: %s compression is not supported.\n", @@ -58,7 +60,10 @@ int main(int argc, char **argv) goto out_if; } - input_file = istream_compressor_create(input_file, ret); + strm = istream_compressor_create(input_file, ret); + sqfs_drop(input_file); + input_file = strm; + if (input_file == NULL) return EXIT_FAILURE; } @@ -80,6 +85,6 @@ int main(int argc, char **argv) out: sqfs_writer_cleanup(&sqfs, status); out_if: - sqfs_destroy(input_file); + sqfs_drop(input_file); return status; } |