summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/base/host_resolver_proc.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/base/host_resolver_proc.cc b/net/base/host_resolver_proc.cc
index 86304dc..d235ce9 100644
--- a/net/base/host_resolver_proc.cc
+++ b/net/base/host_resolver_proc.cc
@@ -223,8 +223,10 @@ int SystemHostResolverProc(const std::string& host,
}
}
if (should_retry) {
- freeaddrinfo(ai);
- ai = NULL;
+ if (ai != NULL) {
+ freeaddrinfo(ai);
+ ai = NULL;
+ }
err = getaddrinfo(host.c_str(), NULL, &hints, &ai);
}