Fix memory leak in HostManager.