Skip to content

Commit

Permalink
ICU-22818 Fix memory leak during error
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankYFTang committed Aug 1, 2024
1 parent bca5fa5 commit 50665c3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions icu4c/source/i18n/messageformat2_data_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,8 @@ MFDataModel::MFDataModel(const MFDataModel::Builder& builder, UErrorCode& errorC
Variant* variants = copyVectorToArray<Variant>(*builder.variants, errorCode);
Expression* selectors = copyVectorToArray<Expression>(*builder.selectors, errorCode);
if (U_FAILURE(errorCode)) {
delete variants;
delete selectors;
bogus = true;
return;
}
Expand Down

0 comments on commit 50665c3

Please sign in to comment.