Changed flow of GetHostByName to ensure destruction even on exception.