Skip to content

free compression and decompression contexts#39578

Merged
alexey-milovidov merged 1 commit intomasterfrom
fix-self-executable-leak
Jul 26, 2022
Merged

free compression and decompression contexts#39578
alexey-milovidov merged 1 commit intomasterfrom
fix-self-executable-leak

Conversation

@yakov-olkhovskiy
Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Fixes memory leaks in compressor and decompressor.
Closes #39572

@robot-ch-test-poll robot-ch-test-poll added the pr-not-for-changelog This PR should not be mentioned in the changelog label Jul 25, 2022
@nickitat nickitat self-assigned this Jul 25, 2022
if (ZSTD_isError(check_result))
{
std::cerr << "Error (ZSTD): " << check_result << " " << ZSTD_getErrorName(check_result) << std::endl;
ZSTD_freeCCtx(cctx);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can create a RAII guard?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we keep it kind of C-ish :)

@nickitat
Copy link
Copy Markdown
Member

sorry, I didn't notice that it is draft

@yakov-olkhovskiy
Copy link
Copy Markdown
Member Author

I'll make it ready to merge after build

@yakov-olkhovskiy yakov-olkhovskiy marked this pull request as ready for review July 25, 2022 22:15
@alexey-milovidov
Copy link
Copy Markdown
Member

LGTM.

I've already forgotten the reason why it is written in "not quite C++" (the worst programming language).

@alexey-milovidov alexey-milovidov merged commit 69e8e56 into master Jul 26, 2022
@alexey-milovidov alexey-milovidov deleted the fix-self-executable-leak branch July 26, 2022 04:47
@alexey-milovidov
Copy link
Copy Markdown
Member

@yakov-olkhovskiy FYI I've checked the links in the Build Check and the binary size is still over 2 GB.

@yakov-olkhovskiy
Copy link
Copy Markdown
Member Author

@alexey-milovidov now we need to replace deployed binaries - it's not replaced on build but rather creates compressed version in programs/self-extracting directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory leak in compressFiles

4 participants