提交 82493d13 编写于 作者: J jgodinez

8010005: [parfait] Memory leak in jdk/src/macosx/native/sun/awt/CTextPipe.m

Reviewed-by: bae, prr
Contributed-by: jia-hong.chen@oracle.com
上级 09e8e99a
......@@ -501,10 +501,22 @@ static inline void doDrawGlyphsPipe_getGlyphVectorLengthAndAlloc
int *uniChars = (int *)malloc(sizeof(int) * length);
CGSize *advances = (CGSize *)malloc(sizeof(CGSize) * length);
if (glyphs == NULL || advances == NULL)
if (glyphs == NULL || uniChars == NULL || advances == NULL)
{
(*env)->DeleteLocalRef(env, glyphsArray);
[NSException raise:NSMallocException format:@"%s-%s:%d", THIS_FILE, __FUNCTION__, __LINE__];
if (glyphs)
{
free(glyphs);
}
if (uniChars)
{
free(uniChars);
}
if (advances)
{
free(advances);
}
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册