Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Unified Diff: source/i18n/ucurr.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/i18n/ucoleitr.cpp ('k') | source/i18n/udat.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/ucurr.cpp
diff --git a/source/i18n/ucurr.cpp b/source/i18n/ucurr.cpp
index 5ee8ceef8cd882704d9a39970d05c9074cbdb381..cb955659f196cf36c9f9627c512bc80197e2c4ee 100644
--- a/source/i18n/ucurr.cpp
+++ b/source/i18n/ucurr.cpp
@@ -1007,6 +1007,12 @@ collectCurrencyNames(const char* locale,
*currencySymbols = (CurrencyNameStruct*)uprv_malloc
(sizeof(CurrencyNameStruct) * (*total_currency_symbol_count));
+ if(currencyNames == NULL || currencySymbols == NULL) {
+ ec = U_MEMORY_ALLOCATION_ERROR;
+ }
+
+ if (U_FAILURE(ec)) return;
+
const UChar* s = NULL; // currency name
char* iso = NULL; // currency ISO code
@@ -1174,6 +1180,15 @@ collectCurrencyNames(const char* locale,
printf("len: %d\n", (*currencySymbols)[index].currencyNameLen);
}
#endif
+ // fail on hashtable errors
+ if (U_FAILURE(ec3)) {
+ ec = ec3;
+ return;
+ }
+ if (U_FAILURE(ec4)) {
+ ec = ec4;
+ return;
+ }
}
// @param currencyNames: currency names array
« no previous file with comments | « source/i18n/ucoleitr.cpp ('k') | source/i18n/udat.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698