mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-21 04:29:31 +00:00
ICU-11177 Fixed a potential memory leak in setParaRunsOnly() in ubidi.c
X-SVN-Rev: 36929
This commit is contained in:
parent
a31ce73748
commit
bc68cc5b15
1 changed files with 5 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
******************************************************************************
|
||||
*
|
||||
* Copyright (C) 1999-2014, International Business Machines
|
||||
* Copyright (C) 1999-2015, International Business Machines
|
||||
* Corporation and others. All Rights Reserved.
|
||||
*
|
||||
******************************************************************************
|
||||
|
@ -2340,7 +2340,7 @@ setParaSuccess(UBiDi *pBiDi) {
|
|||
static void
|
||||
setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length,
|
||||
UBiDiLevel paraLevel, UErrorCode *pErrorCode) {
|
||||
void *runsOnlyMemory;
|
||||
void *runsOnlyMemory = NULL;
|
||||
int32_t *visualMap;
|
||||
UChar *visualText;
|
||||
int32_t saveLength, saveTrailingWSStart;
|
||||
|
@ -2514,12 +2514,13 @@ setParaRunsOnly(UBiDi *pBiDi, const UChar *text, int32_t length,
|
|||
}
|
||||
uprv_memcpy(pBiDi->levels, saveLevels, saveLength*sizeof(UBiDiLevel));
|
||||
pBiDi->trailingWSStart=saveTrailingWSStart;
|
||||
/* free memory for mapping table and visual text */
|
||||
uprv_free(runsOnlyMemory);
|
||||
if(pBiDi->runCount>1) {
|
||||
pBiDi->direction=UBIDI_MIXED;
|
||||
}
|
||||
cleanup3:
|
||||
/* free memory for mapping table and visual text */
|
||||
uprv_free(runsOnlyMemory);
|
||||
|
||||
pBiDi->reorderingMode=UBIDI_REORDER_RUNS_ONLY;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue