You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by fs...@apache.org on 2021/03/08 18:47:34 UTC

[jmeter] branch master updated: Always close filehandle after use

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

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


The following commit(s) were added to refs/heads/master by this push:
     new a5f73f9  Always close filehandle after use
a5f73f9 is described below

commit a5f73f9de74ac7aa2371bb5c7d7d579a051cafa2
Author: Felix Schumacher <fe...@internetallee.de>
AuthorDate: Mon Mar 8 19:47:11 2021 +0100

    Always close filehandle after use
---
 .../main/java/org/apache/jmeter/rmi/SSLRMIClientSocketFactory.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/core/src/main/java/org/apache/jmeter/rmi/SSLRMIClientSocketFactory.java b/src/core/src/main/java/org/apache/jmeter/rmi/SSLRMIClientSocketFactory.java
index 8f4d42d..8064faa 100644
--- a/src/core/src/main/java/org/apache/jmeter/rmi/SSLRMIClientSocketFactory.java
+++ b/src/core/src/main/java/org/apache/jmeter/rmi/SSLRMIClientSocketFactory.java
@@ -121,7 +121,9 @@ public class SSLRMIClientSocketFactory
             throws IOException {
         try {
             KeyStore store = KeyStore.getInstance(type);
-            store.load(new FileInputStream(location), passphrase);
+            try (FileInputStream fis = new FileInputStream(location)) {
+                store.load(fis, passphrase);
+            }
             return store;
         } catch (NoSuchAlgorithmException | CertificateException
                 | KeyStoreException e) {