ICU-23011 Add else branch for remove possible CWE-476

This commit is contained in:
Burkov Egor 2025-01-21 10:21:34 +03:00 committed by Markus Scherer
parent 92b52ae6e3
commit d61ec78c93

View file

@ -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() {