From b8b1565afe83ba91ab9d680736345b2cb050e6ae Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Wed, 19 Nov 2003 23:44:51 +0000 Subject: [PATCH] ICU-3259 Fix a memory leak. X-SVN-Rev: 13778 --- icu4c/source/i18n/smpdtfmt.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/icu4c/source/i18n/smpdtfmt.cpp b/icu4c/source/i18n/smpdtfmt.cpp index 776b2a1849..d467577819 100644 --- a/icu4c/source/i18n/smpdtfmt.cpp +++ b/icu4c/source/i18n/smpdtfmt.cpp @@ -1338,14 +1338,14 @@ int32_t SimpleDateFormat::subParse(const UnicodeString& text, int32_t& start, UC // a little more permissive than RFC 822. It will try to do // its best with numbers that aren't strictly 4 digits long. UErrorCode status = U_ZERO_ERROR; - DecimalFormat *fmt = new DecimalFormat("+####;-####", status); + DecimalFormat fmt("+####;-####", status); if(U_FAILURE(status)) return -start; - fmt->setParseIntegerOnly(TRUE); + fmt.setParseIntegerOnly(TRUE); // WORK AROUND BUG IN NUMBER FORMAT IN 1.2B3 int32_t parseStart = pos.getIndex(); Formattable tzNumber; - fmt->parse( text, tzNumber, pos ); + fmt.parse( text, tzNumber, pos ); if( pos.getIndex() == parseStart) { // WORK AROUND BUG IN NUMBER FORMAT IN 1.2B3 return -start; // Wasn't actually a number.