am bcf861f2: Merge "Don\'t call freeaddrinfo with a NULL ptr."

* commit 'bcf861f246bb06ebba2c070af5b3222c5254970d':
  Don't call freeaddrinfo with a NULL ptr.
This commit is contained in:
Robert Greenwalt 2011-07-29 10:15:21 -07:00 committed by Android Git Automerger
commit dfec555c7f

View File

@ -1860,8 +1860,10 @@ _free_nameservers_locked(struct resolv_cache_info* cache_info)
for (i = 0; i <= MAXNS; i++) {
free(cache_info->nameservers[i]);
cache_info->nameservers[i] = NULL;
freeaddrinfo(cache_info->nsaddrinfo[i]);
cache_info->nsaddrinfo[i] = NULL;
if (cache_info->nsaddrinfo[i] != NULL) {
freeaddrinfo(cache_info->nsaddrinfo[i]);
cache_info->nsaddrinfo[i] = NULL;
}
}
}