fix memory leak in portalLogin.