From be20a502df5e18632a214ab0d5af5ca267f95bde Mon Sep 17 00:00:00 2001 From: Doug Felt Date: Mon, 11 Oct 2004 21:59:44 +0000 Subject: [PATCH] ICU-3634 localized RBNF rule set names - fix error handling in loc data parsing X-SVN-Rev: 16446 --- icu4c/source/i18n/rbnf.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/icu4c/source/i18n/rbnf.cpp b/icu4c/source/i18n/rbnf.cpp index 84a8f13b6d..2e949f29ea 100644 --- a/icu4c/source/i18n/rbnf.cpp +++ b/icu4c/source/i18n/rbnf.cpp @@ -212,7 +212,9 @@ public: status = U_MEMORY_ALLOCATION_ERROR; return; } - uprv_memset(buf + cap / 2, 0, cap / 2 * sizeof(void*)); + void* start = &buf[size]; + size_t count = (cap - size) * sizeof(void*); + uprv_memset(start, 0, count); // fill with nulls, just because } buf[size++] = elem; } @@ -553,6 +555,8 @@ LocDataParser::parseError(const char* str) { uprv_free(data); data = NULL; + p = NULL; + e = NULL; if (U_SUCCESS(ec)) { ec = U_PARSE_ERROR;