diff --git a/icu4c/source/layout/LEGlyphStorage.cpp b/icu4c/source/layout/LEGlyphStorage.cpp index 2ecd1287145..42824c36112 100644 --- a/icu4c/source/layout/LEGlyphStorage.cpp +++ b/icu4c/source/layout/LEGlyphStorage.cpp @@ -119,6 +119,11 @@ le_int32 LEGlyphStorage::allocatePositions(LEErrorCode &success) return -1; } + if (fPositions != NULL) { + success = LE_INTERNAL_ERROR; + return -1; + } + fPositions = LE_NEW_ARRAY(float, 2 * (fGlyphCount + 1)); if (fPositions == NULL) { @@ -136,6 +141,11 @@ le_int32 LEGlyphStorage::allocateAuxData(LEErrorCode &success) return -1; } + if (fAuxData != NULL) { + success = LE_INTERNAL_ERROR; + return -1; + } + fAuxData = LE_NEW_ARRAY(le_uint32, fGlyphCount); if (fAuxData == NULL) {