bzip2: plug memory leak on every processed file
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
2753aae0e8
commit
ed9b08d1c1
@ -128,10 +128,12 @@ IF_DESKTOP(long long) int FAST_FUNC compressStream(unpack_info_t *info UNUSED_PA
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_FEATURE_CLEAN_UP
|
/* Can't be conditional on ENABLE_FEATURE_CLEAN_UP -
|
||||||
|
* we are called repeatedly
|
||||||
|
*/
|
||||||
BZ2_bzCompressEnd(strm);
|
BZ2_bzCompressEnd(strm);
|
||||||
free(iobuf);
|
free(iobuf);
|
||||||
#endif
|
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -361,7 +361,6 @@ int BZ2_bzCompress(bz_stream *strm, int action)
|
|||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------*/
|
/*---------------------------------------------------*/
|
||||||
#if ENABLE_FEATURE_CLEAN_UP
|
|
||||||
static
|
static
|
||||||
void BZ2_bzCompressEnd(bz_stream *strm)
|
void BZ2_bzCompressEnd(bz_stream *strm)
|
||||||
{
|
{
|
||||||
@ -372,9 +371,8 @@ void BZ2_bzCompressEnd(bz_stream *strm)
|
|||||||
free(s->arr2);
|
free(s->arr2);
|
||||||
free(s->ftab);
|
free(s->ftab);
|
||||||
free(s->crc32table);
|
free(s->crc32table);
|
||||||
free(strm->state);
|
free(s);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*---------------------------------------------------*/
|
/*---------------------------------------------------*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user