From ba64bead00ffbd4b1f9e62ca385a4dd601507ce8 Mon Sep 17 00:00:00 2001 From: Markus Scherer Date: Fri, 16 Feb 2018 21:24:57 +0000 Subject: [PATCH] ICU-11954 return nullptr without dereferencing when out-of-memory X-SVN-Rev: 40942 --- icu4c/source/i18n/ucol.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/icu4c/source/i18n/ucol.cpp b/icu4c/source/i18n/ucol.cpp index e53dc92d797..f59333ede3c 100644 --- a/icu4c/source/i18n/ucol.cpp +++ b/icu4c/source/i18n/ucol.cpp @@ -95,6 +95,7 @@ ucol_safeClone(const UCollator *coll, void * /*stackBuffer*/, int32_t * pBufferS Collator *newColl = Collator::fromUCollator(coll)->clone(); if (newColl == NULL) { *status = U_MEMORY_ALLOCATION_ERROR; + return nullptr; } else { *status = U_SAFECLONE_ALLOCATED_WARNING; } -- 2.40.0