Commits

Miki Tebeka committed ee4f636 Merge

Merge pull request #1 from craig-ludington/fix-file-descriptor-leak

Fix file descriptor leak in the digest method with a File argument.

  • Participants
  • Parent commits 5485be8, a985f90

Comments (0)

Files changed (1)

File src/digest.clj

   (digest algorithm [message]))
 
 (defmethod digest File [algorithm ^File file]
-  (digest algorithm (FileInputStream. file)))
+  (with-open [f (FileInputStream. file)]
+    (digest algorithm f)))
 
 (defmethod digest InputStream [algorithm ^InputStream reader]
   (digest algorithm (byte-seq reader)))