RFR [XS] : 8213366: (fs) avoid handle leak in Java_sun_nio_fs_WindowsNativeDispatcher_FindFirstFile0

Baesken, Matthias matthias.baesken at sap.com
Wed Nov 7 09:02:45 UTC 2018


Hi Alan,  Chris     thanks  for  the reviews , pushed !

Btw. while  looking  for other small  leaks  (unrelated to  nio )  


I noticed  a few "shaky"   places  in the Windows-coding when  it comes  to  

FormatMessage(   ...   FORMAT_MESSAGE_ALLOCATE_BUFFER, ... )   +  (missing)   follow-up LocalFree .

Examples :

https://hg.openjdk.java.net/jdk/jdk/file/a0ea20bc7af0/src/jdk.accessibility/windows/native/common/AccessBridgeDebug.cpp#l51

(debug-only code) :

https://hg.openjdk.java.net/jdk/jdk/file/a0ea20bc7af0/src/java.desktop/windows/native/libawt/windows/ThemeReader.cpp#l254

Should  those be fixed in another CR  (or is it considered not so important (just Windows,  and maybe also only debug-related code ?)

Thanks , Matthias


> -----Original Message-----
> From: Alan Bateman <Alan.Bateman at oracle.com>
> Sent: Montag, 5. November 2018 17:11
> To: Baesken, Matthias <matthias.baesken at sap.com>; Chris Hegarty
> <chris.hegarty at oracle.com>; nio-dev at openjdk.java.net
> Subject: Re: RFR [XS] : 8213366: (fs) avoid handle leak in
> Java_sun_nio_fs_WindowsNativeDispatcher_FindFirstFile0
> 
> 
> 
> On 05/11/2018 14:40, Baesken, Matthias wrote:
> > Hi Chris / Alan, here is  the second webrev .
> > It adds  the other missing FindClose call .
> >
> > http://cr.openjdk.java.net/~mbaesken/webrevs/8213366.1/webrev/
> >
> >
> Looks good.


More information about the nio-dev mailing list