jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fschumac...@apache.org
Subject [jmeter] branch master updated: Always close filehandle after use
Date Mon, 08 Mar 2021 18:47:34 GMT
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 <felix.schumacher@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) {


Mime
View raw message