]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/unum.cpp
ICU-66108.tar.gz
[apple/icu.git] / icuSources / i18n / unum.cpp
index c2bd548879cecb30844bc7a965d44b3afcf3bc8a..633b1bb647d3c90e0ff03fc9edd4c0e6441ace57 100644 (file)
@@ -135,6 +135,11 @@ unum_open(  UNumberFormatStyle    style,
         *status = U_MEMORY_ALLOCATION_ERROR;
     }
 
+    if (U_FAILURE(*status) && retVal != NULL) {
+        delete retVal;
+        retVal = NULL;
+    }
+
     return reinterpret_cast<UNumberFormat *>(retVal);
 }