Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit d1d5b6d

Browse files
Merge pull request #213 from hyperwallet/feature/LI-38226_Resource_leak_causes_vulnerable_code_in_Request_class
closed connection to fix security bug.
2 parents 89d171d + c17bb82 commit d1d5b6d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/com/hyperwallet/clientsdk/util/Request.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,11 @@ private BinaryResponse readBinaryResponse() throws IOException {
267267
} catch (IOException e) {
268268
response.setBinaryBody(getBinaryFromStream(connection.getErrorStream()));
269269
}
270-
return response;
270+
finally {
271+
connection.getInputStream().close();
272+
return response;
273+
}
274+
271275
}
272276

273277
private byte[] getBinaryFromStream(final InputStream is) {

0 commit comments

Comments
 (0)