Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak in brotlimt #355

Merged
merged 2 commits into from
Oct 10, 2023
Merged

Conversation

sebres
Copy link
Collaborator

@sebres sebres commented Sep 27, 2023

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:

  • because of return that bypass cleanup (affected only extract with -mmt1)
  • because some entries may still remain in writelist_done or writelist_busy lists and they, in contrast to writelist_free list, will not be freed (so leaking with wl but also large buffer blocks wl->out.buf);

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).

…t was cut or by partial extraction (no return without free, done list may contain not processed entries, so library leaks);

+ small code deduplication
@mcmilk mcmilk merged commit 79b2c78 into mcmilk:master Oct 10, 2023
5 checks passed
@sebres sebres deleted the fix-mem-leak-brotlimt branch October 26, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants