diff options
Diffstat (limited to 'gethost.c')
-rw-r--r-- | gethost.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -307,7 +307,15 @@ struct addrlist *get_address_info ( family = FamilyInternet6; } - if (len > 0 && src != NULL) { + struct addrlist *duplicate; + for(duplicate = retval; duplicate != NULL; duplicate = duplicate->next) { + if(duplicate->family == family && duplicate->len == len && + memcmp(duplicate->address, src, len) == 0) { + break; + } + } + + if (len > 0 && src != NULL && duplicate == NULL) { struct addrlist *newrv = malloc (sizeof(struct addrlist)); if (newrv) { newrv->address = malloc (len); |