Locale Kit: Fix PVS V773

Fix BTimeUnitFormat::Formatunction() was exited
without releasing 'timeUnitAmount' pointer.

Change-Id: I1d3cedd3ca376a7874ce5305b31194ae054e1a0c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2911
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit is contained in:
Murai Takashi 2020-06-13 09:18:44 +09:00 committed by waddlesplash
parent 022f01ea4d
commit 58dbf89d71

View File

@ -121,8 +121,10 @@ BTimeUnitFormat::Format(BString& buffer, const int32 value,
= new TimeUnitAmount((double)value, skUnitMap[unit], icuStatus);
if (timeUnitAmount == NULL)
return B_NO_MEMORY;
if (!U_SUCCESS(icuStatus))
if (!U_SUCCESS(icuStatus)) {
delete timeUnitAmount;
return B_ERROR;
}
Formattable formattable;
formattable.adoptObject(timeUnitAmount);