Fixed memory overflow when server disconnects from client