diff --git a/frameworks/intl/src/i18n_timezone.cpp b/frameworks/intl/src/i18n_timezone.cpp index 39d6dd24..7e911334 100644 --- a/frameworks/intl/src/i18n_timezone.cpp +++ b/frameworks/intl/src/i18n_timezone.cpp @@ -738,9 +738,6 @@ std::string I18nTimeZone::GetDisplayNameByTaboo(const std::string& localeStr, st getReplacedTimezoneDisplayName(localeStr.c_str(), GetID().c_str(), recvArr); } result = recvArr; -#ifndef SUPPORT_ASAN - dlclose(i18nUtilHandle); -#endif return result; } diff --git a/frameworks/intl/src/locale_info.cpp b/frameworks/intl/src/locale_info.cpp index 4129469f..9c72fc8e 100644 --- a/frameworks/intl/src/locale_info.cpp +++ b/frameworks/intl/src/locale_info.cpp @@ -36,7 +36,6 @@ std::set LocaleInfo::GetValidLocales() for (int i = 0; i < validCount; i++) { allValidLocales.insert(validLocales[i].getLanguage()); } - delete[] validLocales; } allValidLocales.insert("in"); allValidLocales.insert("iw"); diff --git a/frameworks/intl/src/phone_number_matched.cpp b/frameworks/intl/src/phone_number_matched.cpp index 9029f00d..2bdb6444 100644 --- a/frameworks/intl/src/phone_number_matched.cpp +++ b/frameworks/intl/src/phone_number_matched.cpp @@ -45,7 +45,6 @@ PhoneNumberMatched::PhoneNumberMatched(std::string& country) PhoneNumberMatched::~PhoneNumberMatched() { delete phoneNumberRule; - delete phoneNumberUtil; delete shortNumberInfo; } @@ -168,7 +167,6 @@ std::vector PhoneNumberMatched::FindShortNumbers(std::string& matchedNumberInfoList.push_back(matcher); } } - delete shortMatch; return matchedNumberInfoList; } @@ -264,7 +262,6 @@ bool PhoneNumberMatched::HandleWithShortAndShort(std::vector& ReplaceSpecifiedPos(filteredString, pos.first, pos.second); flag = true; } - delete matcher; } else { result.push_back(info); ReplaceSpecifiedPos(filteredString, pos.first, pos.second); @@ -454,12 +451,12 @@ std::vector PhoneNumberMatched::HandlePositiveRule(PhoneNumbe icu::RegexPattern* pattern = rule->GetPattern(); UErrorCode status = U_ZERO_ERROR; icu::RegexMatcher* mat1 = pattern->matcher(str, status); - if (mat1->find(status)) { + if (mat1 != nullptr && mat1->find(status)) { std::vector infoList = rule->Handle(match, message); return infoList; } icu::RegexMatcher* mat2 = pattern->matcher(message, status); - if (mat2->find(status)) { + if (mat2 != nullptr &&mat2->find(status)) { std::vector infoList = rule->Handle(match, message); if (infoList.size() == 0) { continue; diff --git a/frameworks/intl/src/regex_rule.cpp b/frameworks/intl/src/regex_rule.cpp index fee69101..91677b08 100644 --- a/frameworks/intl/src/regex_rule.cpp +++ b/frameworks/intl/src/regex_rule.cpp @@ -516,7 +516,6 @@ std::vector RegexRule::HandlePossibleNumberWithPattern(icu::R matchedList.push_back(info); } } - delete mat; return matchedList; } } // namespace I18n