summaryrefslogtreecommitdiffstats
path: root/net/base/address_list.cc
diff options
context:
space:
mode:
Diffstat (limited to 'net/base/address_list.cc')
-rw-r--r--net/base/address_list.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/net/base/address_list.cc b/net/base/address_list.cc
index d2f1974..83df606 100644
--- a/net/base/address_list.cc
+++ b/net/base/address_list.cc
@@ -178,13 +178,22 @@ void AddressList::Append(const struct addrinfo* head) {
} else {
new_head = data_->head;
}
-
// Find the end of current linked list and append new data there.
struct addrinfo* copy_ptr = new_head;
while (copy_ptr->ai_next)
copy_ptr = copy_ptr->ai_next;
- DCHECK(!head->ai_canonname);
copy_ptr->ai_next = CreateCopyOfAddrinfo(head, true);
+
+ // Only the head of the list should have a canonname. Strip any
+ // canonical name in the appended data.
+ copy_ptr = copy_ptr->ai_next;
+ while (copy_ptr) {
+ if (copy_ptr->ai_canonname) {
+ free(copy_ptr->ai_canonname);
+ copy_ptr->ai_canonname = NULL;
+ }
+ copy_ptr = copy_ptr->ai_next;
+ }
}
void AddressList::SetPort(int port) {