[server][SessionManager] Fix a bug that may write data on a freed region.