mattrpav commented on code in PR #699:
URL: https://github.com/apache/activemq/pull/699#discussion_r951988296
##########
activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java:
##########
@@ -320,22 +316,17 @@ protected boolean authenticate(String username, String
password) throws LoginExc
throw new FailedLoginException("Password does not match for
user: " + username);
}
} catch (CommunicationException e) {
+ closeContext();
Review Comment:
Can all the closeContext() calls be moved to a finally {}
##########
activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java:
##########
@@ -187,9 +183,13 @@ public boolean abort() throws LoginException {
return true;
}
- protected void close(DirContext context) {
+ protected void closeContext() {
+ if (context == null) {
+ return;
+ }
try {
context.close();
+ context = null;
Review Comment:
The context = null assignment should probably be in a finally {}
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]