This is an automated email from the ASF dual-hosted git repository.

gaul pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jclouds.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c7fb2c8b9 JCLOUDS-1626: Close stream in MultiBlobInputStream
4c7fb2c8b9 is described below

commit 4c7fb2c8b9f36207cd0b04f6266521412e6678f3
Author: Andrew Gaul <[email protected]>
AuthorDate: Sun Mar 3 12:42:06 2024 +0900

    JCLOUDS-1626: Close stream in MultiBlobInputStream
    
    Otherwise the inner FileInputStream will leak if the caller only reads
    part of the stream before closing the outer MultiBlobInputStream.
---
 .../main/java/org/jclouds/blobstore/config/LocalBlobStore.java    | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git 
a/blobstore/src/main/java/org/jclouds/blobstore/config/LocalBlobStore.java 
b/blobstore/src/main/java/org/jclouds/blobstore/config/LocalBlobStore.java
index 96a9b81f4c..c5ed0effbd 100644
--- a/blobstore/src/main/java/org/jclouds/blobstore/config/LocalBlobStore.java
+++ b/blobstore/src/main/java/org/jclouds/blobstore/config/LocalBlobStore.java
@@ -1036,5 +1036,13 @@ public final class LocalBlobStore implements BlobStore {
             return result;
          }
       }
+
+      @Override
+      public void close() throws IOException {
+          if (current != null) {
+              current.close();
+              current = null;
+          }
+      }
    }
 }

Reply via email to