ICU-1289 uscript_openRun: free UScriptRun if uscript_setRunText returns an error.

X-SVN-Rev: 8639
This commit is contained in:
Eric Mader 2002-05-16 19:23:02 +00:00
parent 98d23f8592
commit cb2212c25f

View file

@ -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;
}