From 310f2f2a22dc6f0eae78d279170482054f6cab85 Mon Sep 17 00:00:00 2001 From: Travis Keep Date: Thu, 15 Aug 2013 00:08:34 +0000 Subject: [PATCH] ICU-10304 Fix MessageFormat::setArgStartFormat() so that it returns immediately after freeing adopted pointer on error. X-SVN-Rev: 34044 --- icu4c/source/i18n/msgfmt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/icu4c/source/i18n/msgfmt.cpp b/icu4c/source/i18n/msgfmt.cpp index 3c2c7c65a1b..874d93826b8 100644 --- a/icu4c/source/i18n/msgfmt.cpp +++ b/icu4c/source/i18n/msgfmt.cpp @@ -1,6 +1,6 @@ /******************************************************************** * COPYRIGHT: - * Copyright (c) 1997-2012, International Business Machines Corporation and + * Copyright (c) 1997-2013, International Business Machines Corporation and * others. All Rights Reserved. ******************************************************************** * @@ -537,6 +537,7 @@ void MessageFormat::setArgStartFormat(int32_t argStart, UErrorCode& status) { if (U_FAILURE(status)) { delete formatter; + return; } if (cachedFormatters == NULL) { cachedFormatters=uhash_open(uhash_hashLong, uhash_compareLong, -- 2.40.0