[git commit master 1/1] bzip2: plug memory leak on every processed file

Denys Vlasenko vda.linux at googlemail.com
Thu Dec 30 03:43:35 UTC 2010


commit: http://git.busybox.net/busybox/commit/?id=ed9b08d1c1bbccd1bcb2c3e06b0095b6b99dc96c
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 archival/bzip2.c               |    6 ++++--
 archival/libarchive/bz/bzlib.c |    4 +---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/archival/bzip2.c b/archival/bzip2.c
index a6abc93..ab08ffc 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
 			break;
 	}
 
-#if ENABLE_FEATURE_CLEAN_UP
+	/* Can't be conditional on ENABLE_FEATURE_CLEAN_UP -
+	 * we are called repeatedly
+	 */
 	BZ2_bzCompressEnd(strm);
 	free(iobuf);
-#endif
+
 	return total;
 }
 
diff --git a/archival/libarchive/bz/bzlib.c b/archival/libarchive/bz/bzlib.c
index b3beeab..5f7db74 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)
 
 
 /*---------------------------------------------------*/
-#if ENABLE_FEATURE_CLEAN_UP
 static
 void BZ2_bzCompressEnd(bz_stream *strm)
 {
@@ -372,9 +371,8 @@ void BZ2_bzCompressEnd(bz_stream *strm)
 	free(s->arr2);
 	free(s->ftab);
 	free(s->crc32table);
-	free(strm->state);
+	free(s);
 }
-#endif
 
 
 /*---------------------------------------------------*/
-- 
1.7.2.2



More information about the busybox-cvs mailing list