Fixed memory leak in client disconnecting