]> granicus.if.org Git - icu/commitdiff
ICU-13739 ICU4C does not report Out-of-Memory when iterating over the TZEnumeration.
authorJeff Genovy <29107334+jefgen@users.noreply.github.com>
Wed, 2 May 2018 19:55:58 +0000 (19:55 +0000)
committerJeff Genovy <29107334+jefgen@users.noreply.github.com>
Wed, 2 May 2018 19:55:58 +0000 (19:55 +0000)
X-SVN-Rev: 41309

icu4c/source/i18n/timezone.cpp

index 113f61c61ea749b1b0658c17036c8c8164c05b19..12c3039d7cb627affdd7a92db25e7354bd3d8d15 100644 (file)
@@ -739,8 +739,7 @@ private:
         len = mapLen;
     }
 
-    UBool getID(int32_t i) {
-        UErrorCode ec = U_ZERO_ERROR;
+    UBool getID(int32_t i, UErrorCode& ec) {
         int32_t idLen = 0;
         const UChar* id = NULL;
         UResourceBundle *top = ures_openDirect(0, kZONEINFO, &ec);
@@ -930,7 +929,7 @@ public:
 
     virtual const UnicodeString* snext(UErrorCode& status) {
         if (U_SUCCESS(status) && map != NULL && pos < len) {
-            getID(map[pos]);
+            getID(map[pos], status);
             ++pos;
             return &unistr;
         }