ICU-11954 return nullptr without dereferencing when out-of-memory
X-SVN-Rev: 40942
This commit is contained in:
parent
cf61e9823a
commit
ba64bead00
@ -95,6 +95,7 @@ ucol_safeClone(const UCollator *coll, void * /*stackBuffer*/, int32_t * pBufferS
|
|||||||
Collator *newColl = Collator::fromUCollator(coll)->clone();
|
Collator *newColl = Collator::fromUCollator(coll)->clone();
|
||||||
if (newColl == NULL) {
|
if (newColl == NULL) {
|
||||||
*status = U_MEMORY_ALLOCATION_ERROR;
|
*status = U_MEMORY_ALLOCATION_ERROR;
|
||||||
|
return nullptr;
|
||||||
} else {
|
} else {
|
||||||
*status = U_SAFECLONE_ALLOCATED_WARNING;
|
*status = U_SAFECLONE_ALLOCATED_WARNING;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user