Skip to content

Close InputStreamReader in readProcessStream - #12710

Open
tejas-ae wants to merge 1 commit into
micronaut-projects:5.1.xfrom
tejas-ae:fix/close-inputstreamreader-in-rea
Open

Close InputStreamReader in readProcessStream#12710
tejas-ae wants to merge 1 commit into
micronaut-projects:5.1.xfrom
tejas-ae:fix/close-inputstreamreader-in-rea

Conversation

@tejas-ae

@tejas-ae tejas-ae commented Jun 7, 2026

Copy link
Copy Markdown

While tracing readProcessStream in inject/src/main/java/io/micronaut/context/env/DefaultEnvironmentAndPackageDeducer.java I noticed what might be an issue: The resource opened there can leak if readProcessStream exits on an error path. this patch moves the allocation into try-with-resources so cleanup happens on every exit path. Let me know if the approach doesn’t fit.

Happy to revise the approach or close this if it doesn’t fit — you know the codebase far better than I do.

@cla-assistant

cla-assistant Bot commented Jun 7, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant