From dc83b7addcbd8609da1ebb7daf03d2d3f8b10af7 Mon Sep 17 00:00:00 2001 From: Laurent Clouet Date: Mon, 16 Mar 2015 11:33:32 +0000 Subject: [PATCH] Bugfix: close file descriptor / stream --- src/com/sheepit/client/Utils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/com/sheepit/client/Utils.java b/src/com/sheepit/client/Utils.java index d778fc6..9ca63de 100644 --- a/src/com/sheepit/client/Utils.java +++ b/src/com/sheepit/client/Utils.java @@ -112,7 +112,10 @@ public class Utils { byte[] buffer = new byte[8192]; while (dis.read(buffer) > 0) ; // process the entire file - return DatatypeConverter.printHexBinary(md.digest()).toLowerCase(); + String data = DatatypeConverter.printHexBinary(md.digest()).toLowerCase(); + dis.close(); + is.close(); + return data; } catch (NoSuchAlgorithmException | IOException e) { return "";