[CP] fix memory leak of cuckoo hashmap

This commit is contained in:
Charles0429
2022-04-22 16:50:47 +08:00
committed by wangzelin.wzl
parent 4e898ddbf3
commit 609e970478

View File

@ -792,6 +792,12 @@ int ObCuckooHashMap<_key_type, _value_type, _hashfunc, _equal>::overflow_set(
overflow_array_ = new_overflow_array;
overflow_capacity_ = overflow_capacity_ + OVERFLOW_EXPAND_COUNT;
done = true;
} else {
for (int64_t i = 0; i < overflow_capacity_ + OVERFLOW_EXPAND_COUNT; ++i) {
new_overflow_array[i].~pair_type();
}
allocator_->free(new_overflow_array);
new_overflow_array = nullptr;
}
}
} else {