Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: source/common/ubidi.c

Issue 907333002: Apply an upstream patch for a resource leak in BiDi (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « patches/bidi.patch ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/common/ubidi.c
diff --git a/source/common/ubidi.c b/source/common/ubidi.c
index 8c0d64b039886930eb4cef319d47d0357576c949..e773de7eb85c6e53df8568dd8aba301183722cd5 100644
--- a/source/common/ubidi.c
+++ b/source/common/ubidi.c
@@ -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;
}
« no previous file with comments | « patches/bidi.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698