diff --git a/icu4c/source/common/brkiter.cpp b/icu4c/source/common/brkiter.cpp index 8b6285ba0a..8a7e3e6434 100644 --- a/icu4c/source/common/brkiter.cpp +++ b/icu4c/source/common/brkiter.cpp @@ -61,16 +61,16 @@ BreakIterator::buildInstance(const Locale& loc, const char *type, UBool dict, UE // Get the locale UResourceBundle *b = ures_open(NULL, loc.getName(), &status); + ures_initStackObject(&brkrules); + ures_initStackObject(&brkname); // Get the "boundaries" array. if (U_SUCCESS(status)) { - ures_initStackObject(&brkrules); (void) ures_getByKeyWithFallback(b, "boundaries", &brkrules, &status); } // Get the string object naming the rules file if (U_SUCCESS(status)) { - ures_initStackObject(&brkname); (void) ures_getByKeyWithFallback(&brkrules, type, &brkname, &status); }