ICU-6132 Check to make sure historicRules[typeIdx] is not null.

X-SVN-Rev: 23257
This commit is contained in:
Michael Ow 2008-01-17 17:48:47 +00:00
parent fc445e22ef
commit a739349c53

View File

@ -704,6 +704,12 @@ OlsonTimeZone::initTransitionRules(UErrorCode& status) {
}
historicRules[typeIdx] = new TimeArrayTimeZoneRule((dst == 0 ? stdName : dstName),
raw, dst, times, nTimes, DateTimeRule::UTC_TIME);
// Check for memory allocation error
if (historicRules[typeIdx] == NULL) {
status = U_MEMORY_ALLOCATION_ERROR;
deleteTransitionRules();
return;
}
}
}
uprv_free(times);