https://issues.apache.org/activemq/browse/AMQ-3052 - memory leak in SimpleAuthenticationBroker

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1038658 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2010-11-24 16:03:22 +00:00
parent aec047d08b
commit 9862d93d95
1 changed files with 7 additions and 1 deletions

View File

@ -92,7 +92,13 @@ public class SimpleAuthenticationBroker extends BrokerFilter {
context.setSecurityContext(s);
securityContexts.add(s);
}
super.addConnection(context, info);
try {
super.addConnection(context, info);
} catch (Exception e) {
securityContexts.remove(s);
context.setSecurityContext(null);
throw e;
}
}
public void removeConnection(ConnectionContext context, ConnectionInfo info, Throwable error)