diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-23 23:33:19 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-23 23:33:19 +0200 |
commit | 824423a9d2395514101cb837c2ede5473cf106ce (patch) | |
tree | ac28f76ad83db93fac4a2cb2252093cfc3ec5c2f /lib/sqfs/blk_proc/serial.c | |
parent | c169887cc5d3ab83e7383234f46ad8963bc22b98 (diff) |
Cleanup block processor error handling
If an error happpens, immediately stop everything and report only the
first error that happened.
This also fixes a memory leak in the error paths of the serial and
pthread based block processors.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/blk_proc/serial.c')
-rw-r--r-- | lib/sqfs/blk_proc/serial.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqfs/blk_proc/serial.c b/lib/sqfs/blk_proc/serial.c index b7bc545..8e842fb 100644 --- a/lib/sqfs/blk_proc/serial.c +++ b/lib/sqfs/blk_proc/serial.c @@ -40,6 +40,8 @@ sqfs_block_processor_t *sqfs_block_processor_create(size_t max_block_size, void sqfs_block_processor_destroy(sqfs_block_processor_t *proc) { + free(proc->fragments); + free(proc->blocks); free(proc); } @@ -53,6 +55,7 @@ int sqfs_block_processor_enqueue(sqfs_block_processor_t *proc, if (block->flags & ~SQFS_BLK_USER_SETTABLE_FLAGS) { proc->status = SQFS_ERROR_UNSUPPORTED; + free(block); return proc->status; } |