diff --git a/icu4c/source/i18n/messageformat2_data_model.cpp b/icu4c/source/i18n/messageformat2_data_model.cpp index 8255de01af06..184fff42d931 100644 --- a/icu4c/source/i18n/messageformat2_data_model.cpp +++ b/icu4c/source/i18n/messageformat2_data_model.cpp @@ -1094,6 +1094,8 @@ MFDataModel::MFDataModel(const MFDataModel::Builder& builder, UErrorCode& errorC Variant* variants = copyVectorToArray(*builder.variants, errorCode); Expression* selectors = copyVectorToArray(*builder.selectors, errorCode); if (U_FAILURE(errorCode)) { + delete variants; + delete selectors; bogus = true; return; }