RFR: 8363676: [GCC static analyzer] missing return value check of malloc in OGLContext_SetTransform

Matthias Baesken mbaesken at openjdk.org
Wed Jul 23 13:55:45 UTC 2025


When using the GCC static analyzer (-fanalyzer) the following issue is reported :
`src/java.desktop/share/native/common/java2d/opengl/OGLContext.c:487:9: warning: use of possibly-NULL '*oglc.xformMatrix' where non-null expected [CWE-690] [-Wanalyzer-possible-null-argument]`

Seems we miss a NULL check of the return value of malloc (at most other places in the coding we do it).

-------------

Commit messages:
 - JDK-8363676

Changes: https://git.openjdk.org/jdk/pull/26443/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26443&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8363676
  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/26443.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26443/head:pull/26443

PR: https://git.openjdk.org/jdk/pull/26443


More information about the client-libs-dev mailing list