RFR: 8373924: Dangling pointer in ImageDecompressor::image_decompressor_close of imageDecompressor.cpp
Henry Jen
henryjen at openjdk.org
Fri Jan 23 18:59:53 UTC 2026
On Fri, 23 Jan 2026 16:48:47 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> I don't see image_decompressor_close actually referenced in the code base, as the decompressors are static and setup from image_decompressor_init().
>>
>> This PR implements proper cleanup for decompressors to be defensive.
>
> src/java.base/share/native/libjimage/imageDecompressor.cpp line 96:
>
>> 94: _decompressors = NULL;
>> 95: _decompressors_num = 0;
>> 96: }
>
> What would you think about removing it? Its dead code and not tested.
We can do that too since it's by design to have same lifespan as the process. I'll run some more tests to confirm removing is safe.
The close can be added when the requirements change.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29371#discussion_r2722455193
More information about the core-libs-dev
mailing list