RFR: 8261154: Memory leak in Java_java_lang_ClassLoader_defineClass0 with long class names [v2]

Claes Redestad redestad at openjdk.java.net
Thu Feb 4 17:04:44 UTC 2021


On Thu, 4 Feb 2021 16:57:37 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> I'm not sure every platform have always agreed free(NULL) is a noop. I suspect all the currently supported ones do, though?
>
>> I'm not sure every platform have always agreed free(NULL) is a noop. I suspect all the currently supported ones do, though?
> 
> Its standard behavior.
> 
> Posix: https://pubs.opengroup.org/onlinepubs/009695399/functions/free.html "If ptr is a null pointer, no action shall occur. "
> Windows: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/free?view=msvc-160 " If memblock is NULL, the pointer is ignored and free immediately returns. "
> 
> So it should be okay.

Right. I dialed back the changes here since this is a bug fix that should be kept minimal. I have another change in the pipeline that will touch code here that can double down on cleaning up.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2407


More information about the core-libs-dev mailing list