diff --git a/src/main/java/com/hyperwallet/clientsdk/util/Request.java b/src/main/java/com/hyperwallet/clientsdk/util/Request.java index 6c12cd26f..5bbcc8da2 100644 --- a/src/main/java/com/hyperwallet/clientsdk/util/Request.java +++ b/src/main/java/com/hyperwallet/clientsdk/util/Request.java @@ -267,7 +267,11 @@ private BinaryResponse readBinaryResponse() throws IOException { } catch (IOException e) { response.setBinaryBody(getBinaryFromStream(connection.getErrorStream())); } - return response; + finally { + connection.getInputStream().close(); + return response; + } + } private byte[] getBinaryFromStream(final InputStream is) {