diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-19 03:34:04 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-08-19 03:34:04 +0200 |
commit | 8b9eeb43c4f7d958972b8bf1fd39d19da570224b (patch) | |
tree | 30e62f3ee716a8caa5c4151a417739ee439360ea /lib | |
parent | 466adf661f1452e8cb8226faf7369e231aee9af3 (diff) |
Fix memory leak in data writer fragment deduplication
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sqfs/data_writer.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/sqfs/data_writer.c b/lib/sqfs/data_writer.c index d88c50e..b52e897 100644 --- a/lib/sqfs/data_writer.c +++ b/lib/sqfs/data_writer.c @@ -239,12 +239,11 @@ static int handle_fragment(data_writer_t *data, block_t *blk) fi->fragment_offset = ref->fragment_offset; fi->fragment = ref->fragment; fi->flags |= FILE_FLAG_FRAGMENT_IS_DUPLICATE; - } else { - if (store_fragment(data, blk)) - return -1; + free(blk); + return 0; } - return 0; + return store_fragment(data, blk); } static int add_sentinel_block(data_writer_t *data, file_info_t *fi, |