mcmilk / 7-Zip-zstd

7-Zip with support for Brotli, Fast-LZMA2, Lizard, LZ4, LZ5 and Zstandard
https://mcmilk.de/projects/7-Zip-zstd/
Other
5.06k stars 300 forks source link

Fix memory leak in brotlimt #355

Closed sebres closed 11 months ago

sebres commented 1 year ago

If MT brotli compression/decompression stops unexpectedly or after canceling, for instance in error case by write, if it was cut or by partial extraction, they may leak:

This fix removes possible memory leakage in such cases.

In addition this PR has a small code deduplication (in brotli-mt_decompress.c:366-371).