On Thu, 4 Feb 2021 15:53:24 GMT, Claes Redestad <redes...@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?

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.

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

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

Reply via email to