mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 15:42:14 +00:00
ICU-22884 Fix assertion and Heap-use-after-free
Issue in icu_76::message2::MessageFormatter::~MessageFormatter
This commit is contained in:
parent
923d02f8d1
commit
fd8a552527
2 changed files with 5 additions and 0 deletions
|
@ -281,6 +281,10 @@ OptionMap::OptionMap(const UVector& opts, UErrorCode& status) : len(opts.size())
|
|||
|
||||
OptionMap::OptionMap(const OptionMap& other) : len(other.len) {
|
||||
U_ASSERT(!other.bogus);
|
||||
if (len == 0) {
|
||||
bogus = false;
|
||||
return;
|
||||
}
|
||||
UErrorCode localErrorCode = U_ZERO_ERROR;
|
||||
Option* result = copyArray(other.options.getAlias(), len, localErrorCode);
|
||||
if (U_FAILURE(localErrorCode)) {
|
||||
|
|
|
@ -150,6 +150,7 @@ namespace message2 {
|
|||
void MessageFormatter::cleanup() noexcept {
|
||||
if (errors != nullptr) {
|
||||
delete errors;
|
||||
errors = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue