From 275580806f3fd99255dcf7ca1e7b806aebb2f08d Mon Sep 17 00:00:00 2001 From: Jeff Genovy <29107334+jefgen@users.noreply.github.com> Date: Wed, 2 May 2018 19:55:58 +0000 Subject: [PATCH] ICU-13739 ICU4C does not report Out-of-Memory when iterating over the TZEnumeration. X-SVN-Rev: 41309 --- icu4c/source/i18n/timezone.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/icu4c/source/i18n/timezone.cpp b/icu4c/source/i18n/timezone.cpp index 113f61c61ea..12c3039d7cb 100644 --- a/icu4c/source/i18n/timezone.cpp +++ b/icu4c/source/i18n/timezone.cpp @@ -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; } -- 2.40.0