ICU-11791 Fix leak in FilteredBreakIteratorBuilder::createInstance for "zh", "fi", ... (i.e. failure case)

X-SVN-Rev: 37928
This commit is contained in:
Peter Edberg 2015-09-10 00:18:11 +00:00
parent 9c2626faa9
commit b5fe5f98c4

View File

@ -652,14 +652,14 @@ FilteredBreakIteratorBuilder *
FilteredBreakIteratorBuilder::createInstance(const Locale& where, UErrorCode& status) {
if(U_FAILURE(status)) return NULL;
LocalPointer<FilteredBreakIteratorBuilder> ret(new SimpleFilteredBreakIteratorBuilder(where, status), status);
return ret.orphan();
return (U_SUCCESS(status))? ret.orphan(): NULL;
}
FilteredBreakIteratorBuilder *
FilteredBreakIteratorBuilder::createInstance(UErrorCode& status) {
if(U_FAILURE(status)) return NULL;
LocalPointer<FilteredBreakIteratorBuilder> ret(new SimpleFilteredBreakIteratorBuilder(status), status);
return ret.orphan();
return (U_SUCCESS(status))? ret.orphan(): NULL;
}
U_NAMESPACE_END