diff options
Diffstat (limited to 'lib/common')
-rw-r--r-- | lib/common/compress.c | 4 | ||||
-rw-r--r-- | lib/common/writer/cleanup.c | 24 | ||||
-rw-r--r-- | lib/common/writer/init.c | 25 |
3 files changed, 25 insertions, 28 deletions
diff --git a/lib/common/compress.c b/lib/common/compress.c index b11efbd..1e0ca06 100644 --- a/lib/common/compress.c +++ b/lib/common/compress.c @@ -32,7 +32,7 @@ SQFS_COMPRESSOR compressor_get_default(void) ret = sqfs_compressor_create(&cfg, &temp); if (ret == 0) { - sqfs_destroy(temp); + sqfs_drop(temp); return cmp_ids[i]; } } @@ -64,7 +64,7 @@ void compressor_print_available(void) have_compressor = false; if (ret == 0) { - sqfs_destroy(temp); + sqfs_drop(temp); have_compressor = true; } else { #ifdef WITH_LZO diff --git a/lib/common/writer/cleanup.c b/lib/common/writer/cleanup.c index 1af7a99..a3fd039 100644 --- a/lib/common/writer/cleanup.c +++ b/lib/common/writer/cleanup.c @@ -10,20 +10,18 @@ void sqfs_writer_cleanup(sqfs_writer_t *sqfs, int status) { - if (sqfs->xwr != NULL) - sqfs_destroy(sqfs->xwr); - - sqfs_destroy(sqfs->dirwr); - sqfs_destroy(sqfs->dm); - sqfs_destroy(sqfs->im); - sqfs_destroy(sqfs->idtbl); - sqfs_destroy(sqfs->data); - sqfs_destroy(sqfs->blkwr); - sqfs_destroy(sqfs->fragtbl); - sqfs_destroy(sqfs->cmp); - sqfs_destroy(sqfs->uncmp); + sqfs_drop(sqfs->xwr); + sqfs_drop(sqfs->dirwr); + sqfs_drop(sqfs->dm); + sqfs_drop(sqfs->im); + sqfs_drop(sqfs->idtbl); + sqfs_drop(sqfs->data); + sqfs_drop(sqfs->blkwr); + sqfs_drop(sqfs->fragtbl); + sqfs_drop(sqfs->cmp); + sqfs_drop(sqfs->uncmp); fstree_cleanup(&sqfs->fs); - sqfs_destroy(sqfs->outfile); + sqfs_drop(sqfs->outfile); if (status != EXIT_SUCCESS) { #if defined(_WIN32) || defined(__WINDOWS__) diff --git a/lib/common/writer/init.c b/lib/common/writer/init.c index 7940c3f..497fc6e 100644 --- a/lib/common/writer/init.c +++ b/lib/common/writer/init.c @@ -70,7 +70,7 @@ int sqfs_writer_init(sqfs_writer_t *sqfs, const sqfs_writer_cfg_t *wrcfg) #ifdef WITH_LZO if (cfg.id == SQFS_COMP_LZO) { if (sqfs->cmp != NULL) - sqfs_destroy(sqfs->cmp); + sqfs_drop(sqfs->cmp); ret = lzo_compressor_create(&cfg, &sqfs->cmp); } @@ -87,7 +87,7 @@ int sqfs_writer_init(sqfs_writer_t *sqfs, const sqfs_writer_cfg_t *wrcfg) #ifdef WITH_LZO if (cfg.id == SQFS_COMP_LZO) { if (ret == 0 && sqfs->uncmp != NULL) - sqfs_destroy(sqfs->uncmp); + sqfs_drop(sqfs->uncmp); ret = lzo_compressor_create(&cfg, &sqfs->uncmp); } @@ -193,27 +193,26 @@ int sqfs_writer_init(sqfs_writer_t *sqfs, const sqfs_writer_cfg_t *wrcfg) return 0; fail_dm: - sqfs_destroy(sqfs->dm); + sqfs_drop(sqfs->dm); fail_im: - sqfs_destroy(sqfs->im); + sqfs_drop(sqfs->im); fail_xwr: - if (sqfs->xwr != NULL) - sqfs_destroy(sqfs->xwr); + sqfs_drop(sqfs->xwr); fail_id: - sqfs_destroy(sqfs->idtbl); + sqfs_drop(sqfs->idtbl); fail_data: - sqfs_destroy(sqfs->data); + sqfs_drop(sqfs->data); fail_fragtbl: - sqfs_destroy(sqfs->fragtbl); + sqfs_drop(sqfs->fragtbl); fail_blkwr: - sqfs_destroy(sqfs->blkwr); + sqfs_drop(sqfs->blkwr); fail_uncmp: - sqfs_destroy(sqfs->uncmp); + sqfs_drop(sqfs->uncmp); fail_cmp: - sqfs_destroy(sqfs->cmp); + sqfs_drop(sqfs->cmp); fail_fs: fstree_cleanup(&sqfs->fs); fail_file: - sqfs_destroy(sqfs->outfile); + sqfs_drop(sqfs->outfile); return -1; } |