mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 06:25:30 +00:00
ICU-20647 Fix TimeZone leak in ucal_open if uloc_setKeywordValue fails.
This commit is contained in:
parent
78f341ce7e
commit
e56b19662c
1 changed files with 4 additions and 4 deletions
|
@ -140,8 +140,8 @@ ucal_open( const UChar* zoneID,
|
|||
|
||||
if(U_FAILURE(*status)) return 0;
|
||||
|
||||
TimeZone* zone = (zoneID==NULL) ? TimeZone::createDefault()
|
||||
: _createTimeZone(zoneID, len, status);
|
||||
LocalPointer<TimeZone> zone( (zoneID==NULL) ? TimeZone::createDefault()
|
||||
: _createTimeZone(zoneID, len, status), *status);
|
||||
|
||||
if (U_FAILURE(*status)) {
|
||||
return NULL;
|
||||
|
@ -157,9 +157,9 @@ ucal_open( const UChar* zoneID,
|
|||
if (U_FAILURE(*status)) {
|
||||
return NULL;
|
||||
}
|
||||
return (UCalendar*)Calendar::createInstance(zone, Locale(localeBuf), *status);
|
||||
return (UCalendar*)Calendar::createInstance(zone.orphan(), Locale(localeBuf), *status);
|
||||
}
|
||||
return (UCalendar*)Calendar::createInstance(zone, Locale(locale), *status);
|
||||
return (UCalendar*)Calendar::createInstance(zone.orphan(), Locale(locale), *status);
|
||||
}
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
|
|
Loading…
Add table
Reference in a new issue