diff options
Diffstat (limited to 'src/feature/relay/dns.c')
-rw-r--r-- | src/feature/relay/dns.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/feature/relay/dns.c b/src/feature/relay/dns.c index dfd84652ad..371c2f5069 100644 --- a/src/feature/relay/dns.c +++ b/src/feature/relay/dns.c @@ -1381,8 +1381,11 @@ configured_nameserver_address(const size_t idx) (struct sockaddr *)&sa, sa_len) > 0) { tor_addr_t *tor_addr = tor_malloc(sizeof(tor_addr_t)); - tor_addr_from_sockaddr(tor_addr, (const struct sockaddr *)&sa, NULL); - return tor_addr; + if (tor_addr_from_sockaddr(tor_addr, + (const struct sockaddr *)&sa, + NULL) == 0) { + return tor_addr; + } } return NULL; |