RFR: 8282628: Potential memory leak in sun.font.FontConfigManager.getFontConfig() [v2]
Alexey Ivanov
aivanov at openjdk.java.net
Tue Mar 8 16:02:03 UTC 2022
On Tue, 8 Mar 2022 15:54:45 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:
>> Please review this small patch that fixes a potential memory leak that exception return fails to release allocated `cacheDirs`
>>
>> Test:
>>
>> - [x] jdk_desktop on Linux x86_64
>
> Zhengyu Gu has updated the pull request incrementally with one additional commit since the last revision:
>
> mrserb and aivanov-jdk's comments
> I did a quick grep, there are a few suspicious spots, e.g. [https://github.com/openjdk/jdk/blob/master/src/java.desktop/windows/native/libawt/windows/awt_Window.cpp#L2711](url), I have yet take a close look.
It doesn't leak the icon handle here, it's assigned to the member of the object (probably `NULL`). Yet it's inconsistent: if an exception is expected from `CreateIconFromRaster` on the line above, why isn't it checked after `CreateIconFromRaster` is called on the following line?
-------------
PR: https://git.openjdk.java.net/jdk/pull/7691
More information about the core-libs-dev
mailing list