On Fri, 16 Oct 2026 08:55:58 GMT, Matthias Baesken <[email protected]> wrote:
> The gcc static analyzer reports this issue :
>
> `jdk/src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c:1195:1:
> warning: leak of 'asd.configs' [CWE-401] [-Wanalyzer-malloc-leak]`
>
> In Java_sun_awt_X11GraphicsConfig_init(JNIEnv *env, jobject this, jint
> visualNum, jint screen)
> we have this coding
>
>
> AwtScreenData asd = x11Screens[screen];
> ...
> if (asd.numConfigs == 0) {
> getAllConfigs(env, screen, &asd); // line 1163 — seems we fill the
> 'local copy' asd only
> }
>
>
> So at the end of function Java_sun_awt_X11GraphicsConfig_init, the leask of
> some asd field is reported.
> (maybe we do not call these init methods very often, so it might be a rare
> issue)
>
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK
> Interim AI Policy](https://openjdk.org/legal/ai).
LGTM. Thanks for fixing it!
-------------
Marked as reviewed by mdoerr (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/33405#pullrequestreview-5582581884