ICU-13765 double free in icu/source/common/serv.cpp

X-SVN-Rev: 41406
This commit is contained in:
Andy Heninger 2018-05-17 23:06:54 +00:00
parent 9006190a53
commit d39d4c7401

View File

@ -547,16 +547,15 @@ outerEnd:
if (putInCache && cacheResult) {
serviceCache->put(result->actualDescriptor, result, status);
if (U_FAILURE(status)) {
delete result;
return NULL;
}
if (cacheDescriptorList._obj != NULL) {
for (int32_t i = cacheDescriptorList._obj->size(); --i >= 0;) {
UnicodeString* desc = (UnicodeString*)cacheDescriptorList._obj->elementAt(i);
serviceCache->put(*desc, result, status);
if (U_FAILURE(status)) {
delete result;
return NULL;
}