Fix the memory leak bug of VectorHeader to_string

This commit is contained in:
hwx65 2024-01-03 11:57:00 +00:00 committed by ob-robot
parent 33600ef896
commit 2e35ef4490

View File

@ -1350,9 +1350,9 @@ int ToStrVectorHeader::to_string_helper(char *buf, const int64_t buf_len) const
ObLength length = vector->get_length(i);
BUF_PRINTF(", len: %d, ptr: %p, hex: ", length, vector->get_payload(i));
hex_print(vector->get_payload(i), length, buf, buf_len, pos);
ObDatum tmp_datum(vector->get_payload(i), length, vector->is_null(i));
ObObj tmp_obj;
ObDatum* tmp_datum = new ObDatum(vector->get_payload(i), length, vector->is_null(i));
if (OB_SUCCESS == tmp_datum->to_obj(tmp_obj, expr_.obj_meta_, expr_.obj_datum_map_)) {
if (OB_SUCCESS == tmp_datum.to_obj(tmp_obj, expr_.obj_meta_, expr_.obj_datum_map_)) {
BUF_PRINTF(", value: ");
pos += tmp_obj.to_string(buf + pos, buf_len - pos);
}