提交 54885402 编写于 作者: O obdev 提交者: wangzelin.wzl

[CP] Repair memory leak in sort operator about stored_rows_.

上级 d0856a50
......@@ -617,8 +617,8 @@ int ObSortOpImpl::init(
default_block_size))) {
LOG_WARN("init row store failed", K(ret));
} else if (batch_size > 0
&& NULL == (stored_rows_ = static_cast<ObChunkDatumStore::StoredRow **>(
mem_context_->get_arena_allocator().alloc(
&& OB_ISNULL(stored_rows_ = static_cast<ObChunkDatumStore::StoredRow **>(
mem_context_->get_malloc_allocator().alloc(
sizeof(*stored_rows_) * batch_size)))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("allocate memory failed", K(ret));
......@@ -699,6 +699,10 @@ void ObSortOpImpl::reset()
mem_context_->get_malloc_allocator().free(ems_heap_);
ems_heap_ = NULL;
}
if (NULL != stored_rows_) {
mem_context_->get_malloc_allocator().free(stored_rows_);
stored_rows_ = NULL;
}
if (NULL != buckets_) {
mem_context_->get_malloc_allocator().free(buckets_);
buckets_ = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册