mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-17 18:56:53 +00:00
ICU-1739 Fix memory leak.
X-SVN-Rev: 8426
This commit is contained in:
parent
332c09868e
commit
0cc587d5d0
1 changed files with 10 additions and 11 deletions
|
@ -943,17 +943,16 @@ void TransliteratorParser::parseRules(const UnicodeString& rule,
|
|||
int32_t withParens = -1;
|
||||
UnicodeSet* f = TransliteratorIDParser::parseGlobalFilter(rule, p, direction, withParens, &idBlock);
|
||||
if (f != NULL) {
|
||||
if (ICU_Utility::parseChar(rule, p, END_OF_RULE)) {
|
||||
if ((direction == UTRANS_FORWARD) ==
|
||||
(withParens == 0)) {
|
||||
if (compoundFilter != NULL) {
|
||||
// Multiple compound filters
|
||||
syntaxError(U_MULTIPLE_COMPOUND_FILTERS, rule, pos);
|
||||
delete f;
|
||||
} else {
|
||||
compoundFilter = f;
|
||||
compoundFilterOffset = idBlockCount;
|
||||
}
|
||||
if (ICU_Utility::parseChar(rule, p, END_OF_RULE)
|
||||
&& (direction == UTRANS_FORWARD) == (withParens == 0))
|
||||
{
|
||||
if (compoundFilter != NULL) {
|
||||
// Multiple compound filters
|
||||
syntaxError(U_MULTIPLE_COMPOUND_FILTERS, rule, pos);
|
||||
delete f;
|
||||
} else {
|
||||
compoundFilter = f;
|
||||
compoundFilterOffset = idBlockCount;
|
||||
}
|
||||
} else {
|
||||
delete f;
|
||||
|
|
Loading…
Add table
Reference in a new issue