asdf2014 commented on a change in pull request #8337: Fix resource leak
URL: https://github.com/apache/incubator-druid/pull/8337#discussion_r315482835
 
 

 ##########
 File path: server/src/main/java/org/apache/druid/server/security/TLSUtils.java
 ##########
 @@ -183,10 +183,12 @@ public static SSLContext createSSLContext(
       KeyStore trustStore = KeyStore.getInstance(trustStoreType == null
                                                ? KeyStore.getDefaultType()
                                                : trustStoreType);
-      trustStore.load(
-          new FileInputStream(trustStorePath),
-          trustStorePasswordProvider == null ? null : 
trustStorePasswordProvider.getPassword().toCharArray()
-      );
+      try (final FileInputStream trustStoreFileStream = new 
FileInputStream(trustStorePath)) {
 
 Review comment:
   Done.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to