Free memory when resolving hostname fails.
Change the allocation function to utilize a pre-allocated buffer for reading
data from the wire.