Skip to content

Commit

Permalink
ICU-23011 Add else branch for remove possible CWE-476
Browse files Browse the repository at this point in the history
  • Loading branch information
wooffie authored Jan 21, 2025
1 parent 2c5e021 commit daf0422
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions icu4c/source/i18n/messageformat2_function_registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ MFFunctionRegistry::Builder::Builder(UErrorCode& errorCode) {
formattersByType = new Hashtable();
if (!(formatters != nullptr && selectors != nullptr && formattersByType != nullptr)) {
errorCode = U_MEMORY_ALLOCATION_ERROR;
} else {
formatters->setValueDeleter(uprv_deleteUObject);
selectors->setValueDeleter(uprv_deleteUObject);
formattersByType->setValueDeleter(uprv_deleteUObject);
}
formatters->setValueDeleter(uprv_deleteUObject);
selectors->setValueDeleter(uprv_deleteUObject);
formattersByType->setValueDeleter(uprv_deleteUObject);
}

MFFunctionRegistry::Builder::~Builder() {
Expand Down

0 comments on commit daf0422

Please sign in to comment.