/*
**********************************************************************
- * Copyright (c) 2001-2004, International Business Machines
+ * Copyright (c) 2001-2008, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
* Date Name Description
}
++len;
UChar *result = (UChar *)uprv_malloc(len*sizeof(UChar));
- uprv_memcpy(result, spec, len*sizeof(result[0]));
+ // Check for memory allocation error.
+ if (result != NULL) {
+ uprv_memcpy(result, spec, len*sizeof(result[0]));
+ }
return result;
}