RFR 8207145 : Native memory leak in WindowsNativeDispatcher

Alan Bateman Alan.Bateman at oracle.com
Thu Jul 12 07:42:11 UTC 2018


On 12/07/2018 07:30, Ivan Gerasimov wrote:
> Hello!
>
> File: src/java.base/windows/native/libnio/fs/WindowsNativeDispatcher.c
> In the native function 
> sun.nio.fs.WindowsNativeDispatcher.LookupPrivilegeValue0() a struct of 
> type LUID is allocated with LocalAlloc().
> If then ::LookupPrivilegeValueW() fails, an exception is thrown, but 
> the memory isn't freed.
>
> Moreover, in file 
> src/java.base/windows/classes/sun/nio/fs/WindowsSecurity.java in 
> function enablePrivilege() the result of successful call to 
> WindowsNativeDispatcher.LookupPrivilegeValue() isn't freed after use.
>
> Would you please help review the fix?
>
> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8207145
> WEBREV: http://cr.openjdk.java.net/~igerasim/8207145/00/webrev/
A good find and the changes look okay.

-Alan


More information about the nio-dev mailing list