RFR [XS] : 8213366: (fs) avoid handle leak in Java_sun_nio_fs_WindowsNativeDispatcher_FindFirstFile0
Alan.Bateman at oracle.com
Mon Nov 5 11:49:22 UTC 2018
On 05/11/2018 11:44, Baesken, Matthias wrote:
> Hello, please review this small fix.
> It adjusts
> In file src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c .
> In this function a Handle “handle” is acquired by calling
> FindFirstFileW .
> However we have an early return in the function, and in this special
> case we miss to close the handle with FindClose .
So if NewString fails with OOME then we invoke the field setting JNI
functions with a pending exception and leak the handle. The proposed
change looks okay to me.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nio-dev