diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-12-30 04:43:35 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-12-30 04:43:35 +0100 |
commit | ed9b08d1c1bbccd1bcb2c3e06b0095b6b99dc96c (patch) | |
tree | bd9a9b9f6b4ced902e90ec7024ca4c6b4dcd1ec7 | |
parent | 2753aae0e8728f527bedf103b1207857b7c3e151 (diff) | |
download | busybox-w32-ed9b08d1c1bbccd1bcb2c3e06b0095b6b99dc96c.tar.gz busybox-w32-ed9b08d1c1bbccd1bcb2c3e06b0095b6b99dc96c.tar.bz2 busybox-w32-ed9b08d1c1bbccd1bcb2c3e06b0095b6b99dc96c.zip |
bzip2: plug memory leak on every processed file
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | archival/bzip2.c | 6 | ||||
-rw-r--r-- | archival/libarchive/bz/bzlib.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/archival/bzip2.c b/archival/bzip2.c index a6abc931c..ab08ffc1a 100644 --- a/archival/bzip2.c +++ b/archival/bzip2.c | |||
@@ -128,10 +128,12 @@ IF_DESKTOP(long long) int FAST_FUNC compressStream(unpack_info_t *info UNUSED_PA | |||
128 | break; | 128 | break; |
129 | } | 129 | } |
130 | 130 | ||
131 | #if ENABLE_FEATURE_CLEAN_UP | 131 | /* Can't be conditional on ENABLE_FEATURE_CLEAN_UP - |
132 | * we are called repeatedly | ||
133 | */ | ||
132 | BZ2_bzCompressEnd(strm); | 134 | BZ2_bzCompressEnd(strm); |
133 | free(iobuf); | 135 | free(iobuf); |
134 | #endif | 136 | |
135 | return total; | 137 | return total; |
136 | } | 138 | } |
137 | 139 | ||
diff --git a/archival/libarchive/bz/bzlib.c b/archival/libarchive/bz/bzlib.c index b3beeabed..5f7db747a 100644 --- a/archival/libarchive/bz/bzlib.c +++ b/archival/libarchive/bz/bzlib.c | |||
@@ -361,7 +361,6 @@ int BZ2_bzCompress(bz_stream *strm, int action) | |||
361 | 361 | ||
362 | 362 | ||
363 | /*---------------------------------------------------*/ | 363 | /*---------------------------------------------------*/ |
364 | #if ENABLE_FEATURE_CLEAN_UP | ||
365 | static | 364 | static |
366 | void BZ2_bzCompressEnd(bz_stream *strm) | 365 | void BZ2_bzCompressEnd(bz_stream *strm) |
367 | { | 366 | { |
@@ -372,9 +371,8 @@ void BZ2_bzCompressEnd(bz_stream *strm) | |||
372 | free(s->arr2); | 371 | free(s->arr2); |
373 | free(s->ftab); | 372 | free(s->ftab); |
374 | free(s->crc32table); | 373 | free(s->crc32table); |
375 | free(strm->state); | 374 | free(s); |
376 | } | 375 | } |
377 | #endif | ||
378 | 376 | ||
379 | 377 | ||
380 | /*---------------------------------------------------*/ | 378 | /*---------------------------------------------------*/ |