Skip to content

Commit 42e535f

Browse files
obdevob-robot
authored andcommitted
fix topn runtime filter memory leak problem
1 parent 1014d2e commit 42e535f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/sql/engine/sort/ob_pd_topn_sort_filter.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,16 @@ int ObPushDownTopNFilter::init(bool is_fetch_with_ties,
106106
enabled_ = true;
107107
}
108108

109+
if (OB_FAIL(ret)) {
110+
if (pd_topn_filter_msg != nullptr) {
111+
(void)pd_topn_filter_msg->destroy();
112+
mem_context_->get_malloc_allocator().free(pd_topn_filter_msg);
113+
pd_topn_filter_msg = nullptr;
114+
pd_topn_filter_msg_ = nullptr;
115+
enabled_ = false;
116+
}
117+
}
118+
109119
LOG_TRACE("[TopN Filter] init topn filter msg");
110120
return ret;
111121
}

0 commit comments

Comments
 (0)