-
Notifications
You must be signed in to change notification settings - Fork 2k
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
pkg/uzlib: warn about memory leak during compression #20293
Conversation
@@ -4,6 +4,10 @@ | |||
* @ingroup sys_compression | |||
* @brief Deflate/Zlib-compatible LZ77 compression/decompression library | |||
* | |||
* @warning During compression, uzlib allocates memory on the heap without freeing it. | |||
* Do not use this package in production code! | |||
* See https://github.com/pfalcon/uzlib/issues/41#issuecomment-1907807048 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds a lot scarier than it is, AFAIU the API is just a bit bad in that it allocates the memory on it's own and int a bit of an opaque location, but it's the outbuf
that then contains the result of the compression.
So it should be enough if we free free(comp.out.outbuf)
once we are done with it, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and it should be possible to fix this with a simple git patch or upstream PR.
Contribution description
uzlib (zlib-compatible compression/decompression) contains a memory leak during compression. Add a warning to the documentation until the issue is resolved upstream, see pfalcon/uzlib#41 (comment)