Cleaning up of allocated string array in Check*CanonicalMatch

X-SVN-Rev: 5618
This commit is contained in:
Syn Wee Quek 2001-08-30 02:58:23 +00:00
parent ed236e08a0
commit e48995b111
2 changed files with 6 additions and 2 deletions

View File

@ -163,8 +163,10 @@ StringSearch::StringSearch(const StringSearch &that) :
StringSearch::~StringSearch()
{
usearch_close(m_strsrch_);
m_search_ = NULL;
if (m_strsrch_ != NULL) {
usearch_close(m_strsrch_);
m_search_ = NULL;
}
}
// operator overloading ---------------------------------------------

View File

@ -1557,6 +1557,7 @@ UBool checkNextCanonicalMatch(UStringSearch *strsrch,
if (strsrch->textIter != coleiter) {
ucol_closeElements(coleiter);
uprv_free(str);
}
strsrch->search->matchedIndex = start;
strsrch->search->matchedLength = *textoffset - start;
@ -2103,6 +2104,7 @@ UBool checkPreviousCanonicalMatch(UStringSearch *strsrch,
if (strsrch->textIter != coleiter) {
ucol_closeElements(coleiter);
uprv_free(str);
}
strsrch->search->matchedIndex = *textoffset;
strsrch->search->matchedLength = end - *textoffset;