diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-01 09:16:48 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-07-01 09:16:48 +0200 |
commit | 6a810548bb9ea0f950ad8cf0a2c008e1cd8fcf23 (patch) | |
tree | f2c4cea3a00012ab21afd2830ced5db5d9287a91 /lib/comp/gzip.c | |
parent | 678261844d162112cc9268e8082be580f7218525 (diff) |
Fix memory leak in gzip compressor
Don't allocate the compressor structure twice.
Bug found using scan-build.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/comp/gzip.c')
-rw-r--r-- | lib/comp/gzip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/comp/gzip.c b/lib/comp/gzip.c index 732245f..379a231 100644 --- a/lib/comp/gzip.c +++ b/lib/comp/gzip.c @@ -304,10 +304,10 @@ fail_value: compressor_t *create_gzip_compressor(bool compress, size_t block_size, char *options) { - gzip_compressor_t *gzip = calloc(1, sizeof(*gzip)); - compressor_t *base = (compressor_t *)gzip; int window = GZIP_DEFAULT_WINDOW; int level = GZIP_DEFAULT_LEVEL; + gzip_compressor_t *gzip; + compressor_t *base; int flags = 0; int ret; |