ICU-5454 Fix some new memory leaks.

X-SVN-Rev: 21981
This commit is contained in:
George Rhoten 2007-07-14 03:58:14 +00:00
parent f7b943c98e
commit 57f9ad80e7
3 changed files with 8 additions and 1 deletions

View File

@ -324,6 +324,9 @@ RuleBasedTimeZone::complete(UErrorCode& status) {
}
}
fUpToDate = TRUE;
if (done != NULL) {
uprv_free(done);
}
return;
cleanup:

View File

@ -1045,6 +1045,8 @@ SimpleTimeZone::initTransitionRules(UErrorCode& status) {
// For now, use ID + "(DST)" as the name
dstRule = new AnnualTimeZoneRule(tzid+"(DST)", getRawOffset(), getDSTSavings(),
*dtRule, startYear, AnnualTimeZoneRule::MAX_YEAR);
delete dtRule;
dtRule = NULL;
// Calculate the first DST start time
dstRule->getFirstStart(getRawOffset(), 0, firstDstStart);
@ -1069,6 +1071,8 @@ SimpleTimeZone::initTransitionRules(UErrorCode& status) {
// For now, use ID + "(STD)" as the name
stdRule = new AnnualTimeZoneRule(tzid+"(STD)", getRawOffset(), 0,
*dtRule, startYear, AnnualTimeZoneRule::MAX_YEAR);
delete dtRule;
dtRule = NULL;
// Calculate the first STD start time
stdRule->getFirstStart(getRawOffset(), dstRule->getDSTSavings(), firstStdStart);

View File

@ -466,7 +466,7 @@ TimeZoneRuleTest::TestRBTZTransition(void) {
// Descending/inclusive
compareTransitionsDescending(*tz, *rbtz, start + 1, until, TRUE);
}
delete trsrules;
delete [] trsrules;
delete rbtz;
delete tz;
}