RFR 8207145 : Native memory leak in WindowsNativeDispatcher

Ivan Gerasimov ivan.gerasimov at oracle.com
Thu Jul 12 13:06:56 UTC 2018


Thank you Alan for reviewing!


On 7/12/18 12:42 AM, Alan Bateman wrote:
> 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
>

-- 
With kind regards,
Ivan Gerasimov



More information about the nio-dev mailing list