]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/common/serv.cpp
ICU-62123.0.1.tar.gz
[apple/icu.git] / icuSources / common / serv.cpp
index 93ae060b617be26cead9a37684f7bde1fbd1ce83..959ab604c68d48629097cb3bef3c34cf7eccfcff 100644 (file)
@@ -1,3 +1,5 @@
+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
 /**
 *******************************************************************************
 * Copyright (C) 2001-2014, International Business Machines Corporation.
@@ -545,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;
                         }