add double-destroy check for MemoryContext

This commit is contained in:
jg0
2021-07-27 19:54:14 +08:00
committed by wangzelin.wzl
parent 91852f9b58
commit 0b7773c43f
86 changed files with 416 additions and 329 deletions

View File

@ -2389,7 +2389,7 @@ int ObSql::transform_stmt_with_outline(
// So we use a memory context to do that
CREATE_WITH_TEMP_CONTEXT(param)
{
ObIAllocator& tmp_allocator = CURRENT_CONTEXT.get_arena_allocator();
ObIAllocator& tmp_allocator = CURRENT_CONTEXT->get_arena_allocator();
ObMaxConcurrentParam::FixParamStore fix_param_store(
OB_MALLOC_NORMAL_BLOCK_SIZE, ObWrapperAllocator(&tmp_allocator));
if (OB_FAIL(ObSQLUtils::get_outline_key(
@ -2462,7 +2462,7 @@ int ObSql::get_outline_info(
int64_t sql_buf_size = pc_ctx.raw_sql_.get_serialize_size();
int64_t sql_pos = 0;
char* sql_buf = NULL;
ObIAllocator& allocator = CURRENT_CONTEXT.get_arena_allocator();
ObIAllocator& allocator = CURRENT_CONTEXT->get_arena_allocator();
if (OB_ISNULL(sql_buf = (char*)allocator.alloc(sql_buf_size))) {
ret = OB_ALLOCATE_MEMORY_FAILED;
LOG_WARN("failed to allocate memory", K(ret));