Don't call freeaddrinfo(NULL) to avoid crash on FreeBSD.

Apparently freeaddrinfo(NULL) is undefined (or at least FreeBSD reads the
appropriate RFCs that way) and FreeBSD crashes in this case.

BUG=FreeBSD crash
TEST=no crash after change on FreeBSD.

Review URL: http://codereview.chromium.org/3360012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58735 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/base/host_resolver_proc.cc b/net/base/host_resolver_proc.cc
index 86304dce..d235ce9 100644
--- a/net/base/host_resolver_proc.cc
+++ b/net/base/host_resolver_proc.cc
@@ -223,8 +223,10 @@
     }
   }
   if (should_retry) {
-    freeaddrinfo(ai);
-    ai = NULL;
+    if (ai != NULL) {
+      freeaddrinfo(ai);
+      ai = NULL;
+    }
     err = getaddrinfo(host.c_str(), NULL, &hints, &ai);
   }