- ruleVector->addElement(new TransliterationRule(
- *(TransliterationRule*)other.ruleVector->elementAt(i)), status);
+ TransliterationRule *tempTranslitRule = new TransliterationRule(*(TransliterationRule*)other.ruleVector->elementAt(i));
+ // Null pointer test
+ if (tempTranslitRule == NULL) {
+ status = U_MEMORY_ALLOCATION_ERROR;
+ break;
+ }
+ ruleVector->addElement(tempTranslitRule, status);
+ if (U_FAILURE(status)) {
+ break;
+ }