From 9991e6a09730e486145d302986b7650a3866dc56 Mon Sep 17 00:00:00 2001 From: George Rhoten Date: Tue, 7 Aug 2007 20:23:09 +0000 Subject: [PATCH] ICU-5708 Fix a memory leak X-SVN-Rev: 22305 --- icu4c/source/i18n/smpdtfmt.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/icu4c/source/i18n/smpdtfmt.cpp b/icu4c/source/i18n/smpdtfmt.cpp index 8a794df13e6..088ed6d7009 100644 --- a/icu4c/source/i18n/smpdtfmt.cpp +++ b/icu4c/source/i18n/smpdtfmt.cpp @@ -921,10 +921,10 @@ SimpleDateFormat::zoneIDCanonicalize(UnicodeString &zid) const UResourceBundle* tryThisZone = ures_getByKey(zoneFormatting,zidkey,NULL,&status); if (U_SUCCESS(status)) { - ures_close(tryThisZone); - ures_close(zoneFormatting); - ures_close(supplementalDataBundle); - return; + ures_close(tryThisZone); + ures_close(zoneFormatting); + ures_close(supplementalDataBundle); + return; } // Didn't find it, so go searching for an alias @@ -932,8 +932,7 @@ SimpleDateFormat::zoneIDCanonicalize(UnicodeString &zid) const while ( ures_hasNext(zoneFormatting)) { UResourceBundle *currentZone = ures_getNextResource(zoneFormatting,NULL,&status); if (U_FAILURE(status)) { - ures_close(supplementalDataBundle); - return; + break; } const char *currentZoneString= ures_getKey(currentZone); @@ -962,8 +961,6 @@ SimpleDateFormat::zoneIDCanonicalize(UnicodeString &zid) const } ures_close(zoneFormatting); ures_close(supplementalDataBundle); - - return; } //----------------------------------------------------------------------