ICU-6132 Add null pointer check to regexcmp.cpp

X-SVN-Rev: 23234
This commit is contained in:
Michael Ow 2008-01-14 22:39:03 +00:00
parent eb21e23b10
commit 82033615bf

View File

@ -307,6 +307,11 @@ void RegexCompile::compile(
//
int32_t numSets = fRXPat->fSets->size();
fRXPat->fSets8 = new Regex8BitSet[numSets];
// Null pointer check.
if (fRXPat->fSets8 == NULL) {
e = *fStatus = U_MEMORY_ALLOCATION_ERROR;
return;
}
int32_t i;
for (i=0; i<numSets; i++) {
UnicodeSet *s = (UnicodeSet *)fRXPat->fSets->elementAt(i);