This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch dev-1.0.0 in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
commit 57f02bc57743b2caec7a2ac0a338355b39c8558b Author: airborne12 <[email protected]> AuthorDate: Mon Mar 28 10:17:13 2022 +0800 [fix](vec) fix coredump for aggregate function when delete large_data, due to alloc-dealloc-mismatch (#8641) --- be/src/vec/aggregate_functions/aggregate_function_min_max.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/be/src/vec/aggregate_functions/aggregate_function_min_max.h b/be/src/vec/aggregate_functions/aggregate_function_min_max.h index 9c2f097..b61131a 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_min_max.h +++ b/be/src/vec/aggregate_functions/aggregate_function_min_max.h @@ -283,7 +283,7 @@ private: char small_data[MAX_SMALL_STRING_SIZE]; /// Including the terminating zero. public: - ~SingleValueDataString() { delete large_data; } + ~SingleValueDataString() { delete[] large_data; } bool has() const { return size >= 0; } @@ -300,7 +300,7 @@ public: if (size != -1) { size = -1; capacity = 0; - delete large_data; + delete[] large_data; large_data = nullptr; } } @@ -324,7 +324,7 @@ public: } else { if (capacity < rhs_size) { capacity = static_cast<UInt32>(round_up_to_power_of_two_or_zero(rhs_size)); - delete large_data; + delete[] large_data; large_data = new char[capacity]; } @@ -354,7 +354,7 @@ public: if (capacity < value_size) { /// Don't free large_data here. capacity = round_up_to_power_of_two_or_zero(value_size); - delete large_data; + delete[] large_data; large_data = new char[capacity]; } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
