提交 8c0474b5 编写于 作者: A azvegint

6788138: leak in Java_sun_awt_X11_XlibWrapper_getStringBytes?

Reviewed-by: pchelko, serb
上级 7bc6f592
......@@ -1236,10 +1236,8 @@ JNIEXPORT jbyteArray JNICALL Java_sun_awt_X11_XlibWrapper_getStringBytes
long length = strlen((char*)str);
jbyteArray res = (*env)->NewByteArray(env, length);
CHECK_NULL_RETURN(res, NULL);
void * storage = malloc(length+1);
memcpy(storage, str, length+1);
(*env)->SetByteArrayRegion(env, res, 0, length,
(const signed char*) storage);
(const signed char*) str);
return res;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册