RFR: 8365626: (fs) Improve handling of broken links in Files.isSameFile() (win) [v4]
Alan Bateman
alanb at openjdk.org
Fri Sep 12 17:34:23 UTC 2025
On Fri, 12 Sep 2025 16:08:58 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
>> Let's go back to L477. If the readAttributes throws, where is the handle closed? The handle is local to the block and isn't encapsulated by an EntryAttributes at this point. I think it would leak but maybe I've missed something, do you mind checking?
>
>> Let's go back to L477. If the readAttributes throws, where is the handle closed?
>
> Oh, you're correct: that looks like a leak. The variable `h` should be closed in a catch block for `readAttributes`. Will fix. Thanks for the "catch".
Same question with the code that follows where it checks !attrs.isSymbolicLink(). Does it leak for this case?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27079#discussion_r2345002690
More information about the nio-dev
mailing list