Cleaning up memory in getRemoteAddr