diff --git a/src/sql/engine/connect_by/ob_nl_cnnt_by_with_index_op.cpp b/src/sql/engine/connect_by/ob_nl_cnnt_by_with_index_op.cpp index 90030b282..ee1809a54 100644 --- a/src/sql/engine/connect_by/ob_nl_cnnt_by_with_index_op.cpp +++ b/src/sql/engine/connect_by/ob_nl_cnnt_by_with_index_op.cpp @@ -271,6 +271,10 @@ int ObNLConnectByWithIndexOp::calc_connect_by_root_exprs(bool is_root) } } if (OB_SUCC(ret)) { + if (OB_NOT_NULL(connect_by_root_row_)) { + mem_context_->get_malloc_allocator().free(connect_by_root_row_); + connect_by_root_row_ = NULL; + } if (OB_FAIL(ObStoredDatumRow::build(connect_by_root_row_, spec.connect_by_root_exprs_, eval_ctx_, mem_context_->get_malloc_allocator()))) { LOG_WARN("failed to build store row", K(ret));