From 7088240fd897a664cb4d7faabf2d4965f64cf952 Mon Sep 17 00:00:00 2001 From: Andy Heninger Date: Mon, 4 May 2009 03:47:05 +0000 Subject: [PATCH] ICU-4790 fix mismatched cases malloc / delete in spoof detector. X-SVN-Rev: 25980 --- icu4c/source/i18n/uspoof.cpp | 12 ++++++------ icu4c/source/i18n/uspoof_impl.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/icu4c/source/i18n/uspoof.cpp b/icu4c/source/i18n/uspoof.cpp index 4feab0aceec..5a53dd92da1 100644 --- a/icu4c/source/i18n/uspoof.cpp +++ b/icu4c/source/i18n/uspoof.cpp @@ -490,10 +490,10 @@ uspoof_areConfusable(const USpoofChecker *sc, } } if (s1Skeleton != s1SkeletonBuf) { - delete s1Skeleton; + uprv_free(s1Skeleton); } if (s2Skeleton != s2SkeletonBuf) { - delete s2Skeleton; + uprv_free(s2Skeleton); } } @@ -548,10 +548,10 @@ uspoof_areConfusableUTF8(const USpoofChecker *sc, int32_t results = uspoof_areConfusable(sc, s1U, lengthS1U, s2U, lengthS2U, status); if (s1U != s1Buf) { - delete s1U; + uprv_free(s1U); } if (s2U != s2Buf) { - delete s2U; + uprv_free(s2U); } return results; } @@ -794,10 +794,10 @@ uspoof_getSkeletonUTF8(const USpoofChecker *sc, cleanup: if (inBuf != smallInBuf) { - delete inBuf; + uprv_free(inBuf); } if (outBuf != smallOutBuf) { - delete outBuf; + uprv_free(outBuf); } return skelLengthInUTF8; } diff --git a/icu4c/source/i18n/uspoof_impl.cpp b/icu4c/source/i18n/uspoof_impl.cpp index d382d92b64c..a763151e90e 100644 --- a/icu4c/source/i18n/uspoof_impl.cpp +++ b/icu4c/source/i18n/uspoof_impl.cpp @@ -787,7 +787,7 @@ NFKDBuffer::NFKDBuffer(const UChar *text, int32_t length, UErrorCode &status) { NFKDBuffer::~NFKDBuffer() { if (fNormalizedText != fSmallBuf) { - delete fNormalizedText; + uprv_free(fNormalizedText); } fNormalizedText = 0; }