Merge pull request #33840 from azat/keeper-zstd-fix-leak

keeper: fix memory leak in case of compression is used (default)
This commit is contained in:
alesapin 2022-01-21 11:41:10 +03:00 committed by GitHub
commit 25547dee91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -84,6 +84,8 @@ void ZstdDeflatingAppendableWriteBuffer::finalizeImpl()
{
if (first_write)
{
/// To free cctx
finalizeZstd();
/// Nothing was written
return;
}
@ -117,6 +119,11 @@ void ZstdDeflatingAppendableWriteBuffer::finalizeBefore()
}
void ZstdDeflatingAppendableWriteBuffer::finalizeAfter()
{
finalizeZstd();
}
void ZstdDeflatingAppendableWriteBuffer::finalizeZstd()
{
try
{

View File

@ -52,6 +52,7 @@ private:
void finalizeImpl() override;
void finalizeBefore() override;
void finalizeAfter() override;
void finalizeZstd();
/// Adding zstd empty block to out.working_buffer
void addEmptyBlock();