From a1e87c60963d7ac736aad01786dc6026fe2c3ac3 Mon Sep 17 00:00:00 2001 From: jbonofre Date: Wed, 26 Feb 2020 18:24:53 +0100 Subject: [PATCH] [AMQ-6833] Cleanly close DirContext in LDAPLoginModule when the authentication is complete --- .../main/java/org/apache/activemq/jaas/LDAPLoginModule.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java b/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java index dced7cefe9..aad8f5003c 100644 --- a/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java +++ b/activemq-jaas/src/main/java/org/apache/activemq/jaas/LDAPLoginModule.java @@ -332,6 +332,10 @@ public class LDAPLoginModule implements LoginModule { throw ex; } + if (context != null) { + close(context); + } + return true; }