Skip to content

Commit 8a3597a

Browse files
committed
Fix leak in gtest_delta_kernel
==13==ERROR: LeakSanitizer: detected memory leaks Direct leak of 112 byte(s) in 1 object(s) allocated from: #0 0x562de572644f in malloc (/home/ubuntu/actions-runner/_work/ClickHouse/ClickHouse/ci/tmp/unit_tests_dbms+0xb7c744f) (BuildId: ece9c88fdfe6a6e98d1a0ed8ab535e80c258c855) #1 0x562e12f3f8d7 in get_testing_kernel_expression (/home/ubuntu/actions-runner/_work/ClickHouse/ClickHouse/ci/tmp/unit_tests_dbms+0x38fe08d7) (BuildId: ece9c88fdfe6a6e98d1a0ed8ab535e80c258c855) CI: https://s3.amazonaws.com/clickhouse-test-reports/PRs/84084/a27e4fcb365a35641c75fc886c90dafc8418b812//unit_tests_asan/job.log
1 parent 4ab70b6 commit 8a3597a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/Storages/tests/gtest_delta_kernel.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
#include <gtest/gtest.h>
21
#include "config.h"
32

43
#if USE_DELTA_KERNEL_RS
54

5+
#include <base/scope_guard.h>
6+
#include <gtest/gtest.h>
67
#include <Common/tests/gtest_global_context.h>
78
#include <Common/tests/gtest_global_register.h>
89
#include <Common/logger_useful.h>
@@ -44,6 +45,7 @@ class DeltaKernelTest : public testing::Test
4445
TEST_F(DeltaKernelTest, ExpressionVisitor)
4546
{
4647
auto * expression = ffi::get_testing_kernel_expression();
48+
SCOPE_EXIT(ffi::free_kernel_expression(expression));
4749
try
4850
{
4951
auto dag = DeltaLake::visitExpression(

0 commit comments

Comments
 (0)