mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-13 00:43:32 +00:00
ICU-1289 uscript_openRun: free UScriptRun if uscript_setRunText returns an error.
X-SVN-Rev: 8639
This commit is contained in:
parent
98d23f8592
commit
cb2212c25f
1 changed files with 6 additions and 1 deletions
|
@ -518,7 +518,12 @@ uscript_openRun(const UChar *src, int32_t length, UErrorCode *pErrorCode)
|
|||
|
||||
uscript_setRunText(result, src, length, pErrorCode);
|
||||
|
||||
/* FIXME: should we free result if setRunText fails? */
|
||||
/* Release the UScriptRun if uscript_setRunText() returns an error */
|
||||
if (U_FAILURE(*pErrorCode)) {
|
||||
uprv_free(result);
|
||||
result = NULL;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue