]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/unesctrn.cpp
ICU-461.18.tar.gz
[apple/icu.git] / icuSources / i18n / unesctrn.cpp
index 45ced8b1e9b7870f7cda55833bda67b230b57620..c3d848d06e9b45e56e3ccc06cc95e688fb8c6d6f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  **********************************************************************
- *   Copyright (c) 2001-2004, International Business Machines
+ *   Copyright (c) 2001-2008, International Business Machines
  *   Corporation and others.  All Rights Reserved.
  **********************************************************************
  *   Date        Name        Description
@@ -82,7 +82,10 @@ static UChar* copySpec(const UChar* spec) {
     }
     ++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;
 }