Audit getaddrinfo() uses for proper freeing, redmine #6539.

here you test for NULL