Bug 511469 - Memory Leak in AbstractConnectionManager

* Clean up map in case of TimeOut

Change-Id: Ib52b749aaee700df83ba4669c71c5ccb08898310
Signed-off-by: Johannes Faltermeier <jfaltermeier@eclipsesource.com>
diff --git a/bundles/org.eclipse.emf.emfstore.server/src/org/eclipse/emf/emfstore/server/auth/ESSessions.java b/bundles/org.eclipse.emf.emfstore.server/src/org/eclipse/emf/emfstore/server/auth/ESSessions.java
index 0a11acb..858a928 100644
--- a/bundles/org.eclipse.emf.emfstore.server/src/org/eclipse/emf/emfstore/server/auth/ESSessions.java
+++ b/bundles/org.eclipse.emf.emfstore.server/src/org/eclipse/emf/emfstore/server/auth/ESSessions.java
@@ -100,7 +100,12 @@
 			return null;
 		}
 
-		return container.getUser().toAPI();
+		try {
+			return container.getUser().toAPI();
+		} catch (final SessionTimedOutException ex) {
+			remove(sessionId);
+			throw ex;
+		}
 	}
 
 	/**
@@ -121,7 +126,12 @@
 			return null;
 		}
 
-		return container.getUser().getId().toAPI();
+		try {
+			return container.getUser().getId().toAPI();
+		} catch (final SessionTimedOutException ex) {
+			remove(sessionId);
+			throw ex;
+		}
 	}
 
 	/**