aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/common/stream_encoder.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2011-04-02 14:49:56 +0300
committerLasse Collin <lasse.collin@tukaani.org>2011-04-05 15:27:48 +0300
commitaa95516d3d509c6b7895ee519004afcf500a0759 (patch)
treeb22d23c1cd65df514dbe6c9055c792884734c31c /src/liblzma/common/stream_encoder.c
parentBumped version and liblzma soname to 5.0.2. (diff)
downloadxz-aa95516d3d509c6b7895ee519004afcf500a0759.tar.xz
liblzma: Fix a memory leak in stream_encoder.c.
It leaks old filter options structures (hundred bytes or so) every time the lzma_stream is reinitialized. With the xz tool, this happens when compressing multiple files.
Diffstat (limited to '')
-rw-r--r--src/liblzma/common/stream_encoder.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/liblzma/common/stream_encoder.c b/src/liblzma/common/stream_encoder.c
index 48d91da7..97a7a23a 100644
--- a/src/liblzma/common/stream_encoder.c
+++ b/src/liblzma/common/stream_encoder.c
@@ -280,6 +280,7 @@ lzma_stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
next->end = &stream_encoder_end;
next->update = &stream_encoder_update;
+ next->coder->filters[0].id = LZMA_VLI_UNKNOWN;
next->coder->block_encoder = LZMA_NEXT_CODER_INIT;
next->coder->index_encoder = LZMA_NEXT_CODER_INIT;
next->coder->index = NULL;
@@ -289,7 +290,6 @@ lzma_stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
next->coder->sequence = SEQ_STREAM_HEADER;
next->coder->block_options.version = 0;
next->coder->block_options.check = check;
- next->coder->filters[0].id = LZMA_VLI_UNKNOWN;
// Initialize the Index
lzma_index_end(next->coder->index, allocator);