mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-16 10:17:23 +00:00
ICU-6911 Ensure that memory is freed before setting to NULL.
X-SVN-Rev: 27835
This commit is contained in:
parent
a2ba018519
commit
2297d39ef2
1 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
******************************************************************************
|
||||
* Copyright (C) 2001-20109, International Business Machines
|
||||
* Copyright (C) 2001-2010, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
******************************************************************************
|
||||
*
|
||||
|
@ -684,6 +684,10 @@ ucol_setText( UCollationElements *elems,
|
|||
|
||||
/* free offset buffer to avoid memory leak before initializing. */
|
||||
ucol_freeOffsetBuffer(&(elems->iteratordata_));
|
||||
/* Ensure that previously allocated extendCEs is freed before setting to NULL. */
|
||||
if (elems->iteratordata_.extendCEs != NULL) {
|
||||
uprv_free(elems->iteratordata_.extendCEs);
|
||||
}
|
||||
uprv_init_collIterate(elems->iteratordata_.coll, text, textLength,
|
||||
&elems->iteratordata_, status);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue