Description
In code that was added by JDK-8238358 there's a potentially malloc'ed string that is never freed.
utfName = getUTF(env, name, buf, sizeof(buf));
The solution is to do what _defineClass1 and _defineClass2 is already doing and free utfName after use if it's non-NULL and different from buf (getUTF returns buf if the string fits):
if (utfName != NULL && utfName != buf) {
free(utfName);
}
utfName = getUTF(env, name, buf, sizeof(buf));
The solution is to do what _defineClass1 and _defineClass2 is already doing and free utfName after use if it's non-NULL and different from buf (getUTF returns buf if the string fits):
if (utfName != NULL && utfName != buf) {
free(utfName);
}