mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-6132 Check for memory allocation error in setText(UText).
X-SVN-Rev: 23260
This commit is contained in:
parent
6c61aa48a8
commit
15b23ccd3f
1 changed files with 6 additions and 0 deletions
|
@ -324,6 +324,12 @@ void RuleBasedBreakIterator::setText(UText *ut, UErrorCode &status) {
|
|||
static const UChar c = 0;
|
||||
fDCharIter = new UCharCharacterIterator(&c, 0);
|
||||
}
|
||||
|
||||
// Check for Null pointer
|
||||
if (fDCharIter == NULL) {
|
||||
status = U_MEMORY_ALLOCATION_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
if (fCharIter!=fSCharIter && fCharIter!=fDCharIter) {
|
||||
// existing fCharIter was adopted from the outside. Delete it now.
|
||||
|
|
Loading…
Add table
Reference in a new issue