Skip to content
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

Potential memory leak #15

Closed
1 task done
Katsute opened this issue Apr 7, 2020 · 0 comments · Fixed by #18
Closed
1 task done

Potential memory leak #15

Katsute opened this issue Apr 7, 2020 · 0 comments · Fixed by #18
Assignees
Labels
bug Something isn't working as expected optimization Optimizations

Comments

@Katsute
Copy link
Member

Katsute commented Apr 7, 2020

Prerequisites

If all checks are not passed then the issue will be closed

  • I have checked that no other similar issue already exists

Operating System: Operating system name and version
Windows 10

Release Version: Release version or branch where the issue occurred
v02.00.00+

Issue

Explain your issue. Add any screenshots here

final InputStream IN = httpExchange.getRequestBody();
try(final Scanner scanner = new Scanner(IN,StandardCharsets.UTF_8)){
OUT = scanner.useDelimiter("\\A").next();
IN.close();
}catch(IOException | NoSuchElementException e){
OUT = null;
}

Stream does not close if an exception is thrown (use finally)

@Katsute Katsute added the bug Something isn't working as expected label Apr 7, 2020
@Katsute Katsute self-assigned this Apr 7, 2020
@Katsute Katsute added the optimization Optimizations label Apr 7, 2020
Katsute added a commit that referenced this issue Apr 8, 2020
@Katsute Katsute mentioned this issue Apr 8, 2020
5 tasks
Katsute added a commit that referenced this issue Apr 8, 2020
* Fixed memory leak #15 #16

* Update pom.xml

Co-authored-by: Katsute <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working as expected optimization Optimizations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant