[CP] to issue<2024121300106459296>:fix two memory leak

This commit is contained in:
hanr881 2025-01-02 15:15:42 +00:00 committed by ob-robot
parent d443b2f26a
commit dab2a7db7b
3 changed files with 9 additions and 3 deletions

View File

@ -2774,7 +2774,6 @@ int ObPLCodeGenerateVisitor::visit(const ObPLCallStmt &s)
OZ (generator_.get_llvm_type(*pl_type, ir_type));
OZ (ir_type.get_pointer_to(ir_ptr_type));
OZ (generator_.get_helper().create_int_to_ptr(ObString("cast_extend_to_ptr"), extend_value, ir_ptr_type, value));
OZ (pl_type->generate_construct(generator_, *s.get_namespace(), value, allocator, true, &s));
if (OB_SUCC(ret) && pl_type->is_collection_type()) {
const ObUserDefinedType *user_type = NULL;
@ -2807,6 +2806,7 @@ int ObPLCodeGenerateVisitor::visit(const ObPLCallStmt &s)
var_addr));
OZ (generator_.extract_obobj_ptr_from_objparam(p_result_obj, p_dest_value));
OZ (generator_.generate_set_extend(p_dest_value, var_type, init_value, var_addr));
OZ (pl_type->generate_construct(generator_, *s.get_namespace(), value, allocator, true, &s));
}
}
} else {

View File

@ -2277,7 +2277,10 @@ int ObPLCursorInfo::deep_copy(ObPLCursorInfo &src, common::ObIAllocator *allocat
LOG_WARN("failed to copy pl extend", K(ret));
} else {
obj = tmp;
dest_cursor->complex_objs_.push_back(tmp);
if (OB_FAIL(dest_cursor->complex_objs_.push_back(tmp))) {
int tmp_ret = ObUserDefinedType::destruct_obj(tmp, dest_cursor->session_info_);
LOG_WARN("fail to push back", K(ret), K(tmp_ret));
}
}
}
}

View File

@ -8399,7 +8399,10 @@ int ObSPIService::fill_cursor(ObResultSet &result_set,
LOG_WARN("failed to copy pl extend", K(ret));
} else {
obj = tmp;
cursor->complex_objs_.push_back(tmp);
if (OB_FAIL(cursor->complex_objs_.push_back(tmp))) {
int tmp_ret = ObUserDefinedType::destruct_obj(tmp, cursor->session_info_);
LOG_WARN("fail to push back", K(ret), K(tmp_ret));
}
}
}
}