RFR 8207753 : Handle to process snapshot is leaked if Process32First() fails

Ivan Gerasimov ivan.gerasimov at oracle.com
Thu Jul 19 03:19:00 UTC 2018


In native functions java.lang.ProcessHandleImpl.getProcessPids0() and 
java.lang.ProcessHandleImpl.parent0() a handle to a snapshot of all 
processes in the system is obtained with CreateToolhelp32Snapshot().

This handle isn't releases if the subsequent call to Process32First() fails.

Would you please help review a trivial fix?

BUGURL: https://bugs.openjdk.java.net/browse/JDK-8207753
WEBREV: http://cr.openjdk.java.net/~igerasim/8207753/00/webrev/

Thanks in advance!

With kind regards,
Ivan Gerasimov

More information about the core-libs-dev mailing list