[jdk21u-dev] RFR: 8210471: GZIPInputStream constructor could leak an un-end()ed Inflater

Daniel Hu duke at openjdk.org
Wed Apr 30 23:44:05 UTC 2025


Clean backport. The change ensures the Inflater in `GZIPInputStream` is ended for GC when `GZIPInputStream`'s constructor throws an exception, as prior the change the Inflater is left open in that scenario. GHA passes. Added test and test suite `test/jdk/java/util/zip` passes on linux x64. Note that the added test does not test for this specific issue; rather, it's a basic test for `GZIPInputStream`'s constructor as otherwise no test exists.

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

Commit messages:
 - Backport d9e7b7e7da98a0170d26301a4bbd61aad0127c6e

Changes: https://git.openjdk.org/jdk21u-dev/pull/1725/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk21u-dev&pr=1725&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8210471
  Stats: 118 lines in 2 files changed: 116 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk21u-dev/pull/1725.diff
  Fetch: git fetch https://git.openjdk.org/jdk21u-dev.git pull/1725/head:pull/1725

PR: https://git.openjdk.org/jdk21u-dev/pull/1725


More information about the jdk-updates-dev mailing list