ICU-11954 return nullptr without dereferencing when out-of-memory

X-SVN-Rev: 40942
This commit is contained in:
Markus Scherer 2018-02-16 21:24:57 +00:00
parent cf61e9823a
commit ba64bead00

View File

@ -95,6 +95,7 @@ ucol_safeClone(const UCollator *coll, void * /*stackBuffer*/, int32_t * pBufferS
Collator *newColl = Collator::fromUCollator(coll)->clone();
if (newColl == NULL) {
*status = U_MEMORY_ALLOCATION_ERROR;
return nullptr;
} else {
*status = U_SAFECLONE_ALLOCATED_WARNING;
}